mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 01:28:00 +01:00
Fix reverting use of IndexedDB as default cache storage on Chromium
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/399 The advanced setting `cacheStorageAPI` has been added to allow a user to force the use of IndexedDB as cache storage. Set to `IndexedDB` to force use of IndexedDB. Default to `unset`.
This commit is contained in:
parent
185ebf0d7d
commit
a026e9ae54
3 changed files with 7 additions and 2 deletions
|
@ -43,6 +43,7 @@ const µBlock = (function() { // jshint ignore:line
|
|||
autoCommentFilterTemplate: '{{date}} {{origin}}',
|
||||
autoUpdateAssetFetchPeriod: 120,
|
||||
autoUpdatePeriod: 7,
|
||||
cacheStorageAPI: 'unset',
|
||||
cacheStorageCompression: true,
|
||||
cacheControlForFirefox1376932: 'no-cache, no-store, must-revalidate',
|
||||
debugScriptlets: false,
|
||||
|
|
|
@ -48,9 +48,12 @@
|
|||
// https://github.com/uBlockOrigin/uBlock-issues/issues/328
|
||||
// Use IndexedDB for Chromium as well, to take advantage of LZ4
|
||||
// compression.
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/399
|
||||
// Revert Chromium support of IndexedDB, use advanced setting to force
|
||||
// IndexedDB.
|
||||
if (
|
||||
vAPI.webextFlavor.soup.has('firefox') === false &&
|
||||
vAPI.webextFlavor.soup.has('chromium') === false
|
||||
µBlock.hiddenSettings.cacheStorageAPI.toLowerCase() !== 'indexeddb'
|
||||
) {
|
||||
// In case IndexedDB was used as cache storage, remove it.
|
||||
indexedDB.deleteDatabase(STORAGE_NAME);
|
||||
|
|
|
@ -186,9 +186,10 @@
|
|||
vAPI.localStorage.setItem(
|
||||
'immediateHiddenSettings',
|
||||
JSON.stringify({
|
||||
cacheStorageAPI: this.hiddenSettings.cacheStorageAPI,
|
||||
disableWebAssembly: this.hiddenSettings.disableWebAssembly,
|
||||
suspendTabsUntilReady: this.hiddenSettings.suspendTabsUntilReady,
|
||||
userResourcesLocation: this.hiddenSettings.userResourcesLocation
|
||||
userResourcesLocation: this.hiddenSettings.userResourcesLocation,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue