diff --git a/src/js/cachestorage.js b/src/js/cachestorage.js index 88b2c67ee..241864201 100644 --- a/src/js/cachestorage.js +++ b/src/js/cachestorage.js @@ -63,10 +63,26 @@ const storageLocal = webext.storage.local; const cacheStorage = { name: 'browser.storage.local', - get: storageLocal.get.bind(storageLocal), - set: storageLocal.set.bind(storageLocal), - remove: storageLocal.remove.bind(storageLocal), - clear: storageLocal.clear.bind(storageLocal), + get: (...args) => { + return storageLocal.get(...args).catch(reason => { + console.log(reason); + }); + }, + set: (...args) => { + return storageLocal.set(...args).catch(reason => { + console.log(reason); + }); + }, + remove: (...args) => { + return storageLocal.remove(...args).catch(reason => { + console.log(reason); + }); + }, + clear: (...args) => { + return storageLocal.clear(...args).catch(reason => { + console.log(reason); + }); + }, // Not all platforms support getBytesInUse getBytesInUse: storageLocal.getBytesInUse ? storageLocal.getBytesInUse.bind(storageLocal) diff --git a/src/js/start.js b/src/js/start.js index eb109432c..166871e2a 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -265,7 +265,7 @@ const onUserSettingsReady = fetched => { // https://github.com/uBlockOrigin/uBlock-issues/issues/1365 // Wait for removal of invalid cached data to be completed. -const onCacheSettingsReady = async fetched => { +const onCacheSettingsReady = async (fetched = {}) => { if ( fetched.compiledMagic !== µb.systemSettings.compiledMagic ) { µb.compiledFormatChanged = true; µb.selfieIsInvalid = true;