diff --git a/src/js/scriptlets/element-picker.js b/src/js/scriptlets/element-picker.js index 5e6325c661486..8f417aa2fc769 100644 --- a/src/js/scriptlets/element-picker.js +++ b/src/js/scriptlets/element-picker.js @@ -1040,7 +1040,7 @@ const userFilterFromCandidate = function(callback) { // Cosmetic filter? if ( v.startsWith('##') ) { - callback(hostname + v); + callback(hostname + v, true); return; } @@ -1188,8 +1188,8 @@ const onDialogClicked = function(ev) { // We have to exit from preview mode: this guarantees matching elements // will be found for the candidate filter. filterToDOMInterface.preview(false); - userFilterFromCandidate(filter => { - if ( !filter ) { return; } + userFilterFromCandidate((filter = undefined, isCosmetic = false) => { + if ( filter === undefined ) { return; } vAPI.messaging.send( 'elementPicker', { @@ -1197,7 +1197,8 @@ const onDialogClicked = function(ev) { autoComment: true, filters: filter, origin: window.location.origin, - pageDomain: window.location.hostname + pageDomain: window.location.hostname, + killCache: isCosmetic === false, } ); filterToDOMInterface.preview(rawFilterFromTextarea(), true); diff --git a/src/js/storage.js b/src/js/storage.js index 73a7b58511735..51861aec94bc5 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -468,6 +468,12 @@ this.redirectEngine.freeze(); this.staticExtFilteringEngine.freeze(); this.selfieManager.destroy(); + + // https://www.reddit.com/r/uBlockOrigin/comments/cj7g7m/ + // https://www.reddit.com/r/uBlockOrigin/comments/cnq0bi/ + if ( options.killCache ) { + browser.webRequest.handlerBehaviorChanged(); + } }; const onLoaded = details => {