diff --git a/src/js/assets.js b/src/js/assets.js index 79a05c380..e368d1f55 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -271,6 +271,10 @@ var cachedAssetsManager = (function() { getEntries(onEntries); }; + exports.rmrf = function() { + exports.remove(/./); + }; + exports.onRemovedListener = null; return exports; @@ -468,6 +472,9 @@ var getRepoMetadata = function(callback) { /******************************************************************************/ exports.setHomeURL = function(path, homeURL) { + if ( typeof homeURL !== 'string' || homeURL === '' ) { + return; + } homeURLs[path] = homeURL; }; @@ -1029,6 +1036,12 @@ exports.put = function(path, content, callback) { /******************************************************************************/ +exports.rmrf = function() { + cachedAssetsManager.rmrf(); +}; + +/******************************************************************************/ + exports.metadata = function(callback) { var out = {}; diff --git a/src/js/messaging.js b/src/js/messaging.js index e2349b749..313ac9a07 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -1058,6 +1058,10 @@ var restoreUserData = function(request) { }, onCountdown); }; + // https://github.com/gorhill/uBlock/issues/1102 + // Ensure all currently cached assets are flushed from storage AND memory. + µb.assets.rmrf(); + // If we are going to restore all, might as well wipe out clean local // storage µb.XAL.keyvalRemoveAll(onAllRemoved);