mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 17:41:03 +01:00
Do not fall back to alternative cache backend if selected one fails
Default behavior is to fall back to an alternative backend if the uBO-selected one is not available. However there will be no fall back when the `cacheStorageAPI` is set to one specific backend by the user.
This commit is contained in:
parent
87feb47b51
commit
b585518c00
1 changed files with 7 additions and 6 deletions
|
@ -112,15 +112,16 @@
|
|||
});
|
||||
});
|
||||
},
|
||||
select: function(backend) {
|
||||
if ( backend === undefined || backend === 'unset' ) {
|
||||
backend = vAPI.webextFlavor.soup.has('firefox')
|
||||
select: function(selectedBackend) {
|
||||
let actualBackend = selectedBackend;
|
||||
if ( actualBackend === undefined || actualBackend === 'unset' ) {
|
||||
actualBackend = vAPI.webextFlavor.soup.has('firefox')
|
||||
? 'indexedDB'
|
||||
: 'browser.storage.local';
|
||||
}
|
||||
if ( backend === 'indexedDB' ) {
|
||||
if ( actualBackend === 'indexedDB' ) {
|
||||
return selectIDB().then(success => {
|
||||
if ( success ) {
|
||||
if ( success || selectedBackend === 'indexedDB' ) {
|
||||
clearWebext();
|
||||
return 'indexedDB';
|
||||
}
|
||||
|
@ -128,7 +129,7 @@
|
|||
return 'browser.storage.local';
|
||||
});
|
||||
}
|
||||
if ( backend === 'browser.storage.local' ) {
|
||||
if ( actualBackend === 'browser.storage.local' ) {
|
||||
clearIDB();
|
||||
}
|
||||
return Promise.resolve('browser.storage.local');
|
||||
|
|
Loading…
Reference in a new issue