From 41133dffd29f79b5281dae254142c79d0493da63 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 24 Feb 2020 16:16:06 -0500 Subject: [PATCH] Fix remnants of uBO code in cache storage manager Related feedback: - https://github.com/uBlockOrigin/uMatrix-issues/issues/227#issuecomment-590543891 --- src/js/background.js | 2 ++ src/js/cachestorage.js | 4 ++-- src/js/start.js | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 502b03e..3fc2a91 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -57,6 +57,8 @@ const rawSettingsDefault = { assetFetchBypassBrowserCache: false, assetFetchTimeout: 30, autoUpdateAssetFetchPeriod: 120, + cacheStorageAPI: 'unset', + cacheStorageCompression: true, cnameIgnoreList: 'unset', cnameIgnore1stParty: true, cnameIgnoreExceptions: true, diff --git a/src/js/cachestorage.js b/src/js/cachestorage.js index 60f6eec..1b47fdc 100644 --- a/src/js/cachestorage.js +++ b/src/js/cachestorage.js @@ -119,7 +119,7 @@ disconnect(); }, Math.max( - µMatrix.hiddenSettings.autoUpdateAssetFetchPeriod * 2 * 1000, + µMatrix.rawSettings.autoUpdateAssetFetchPeriod * 2 * 1000, 180000 ) ); @@ -296,7 +296,7 @@ const promises = [ getDb() ]; const entries = []; const dontCompress = - µMatrix.hiddenSettings.cacheStorageCompression !== true; + µMatrix.rawSettings.cacheStorageCompression !== true; const handleEncodingResult = result => { entries.push({ key: result.key, value: result.data }); }; diff --git a/src/js/start.js b/src/js/start.js index bd37cc9..f0e1336 100644 --- a/src/js/start.js +++ b/src/js/start.js @@ -32,6 +32,11 @@ ]); log.info(`User settings ready ${Date.now()-vAPI.T0} ms after launch`); + const cacheBackend = await µm.cacheStorage.select( + µm.rawSettings.cacheStorageAPI + ); + log.info(`Backend storage for cache will be ${cacheBackend}`); + const shouldWASM = vAPI.canWASM === true && µm.rawSettings.disableWebAssembly !== true;