diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index f12ff0506..14c033fe3 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -408,9 +408,10 @@ SelectorCacheEntry.prototype.add = function(selectors, type) { // https://github.com/gorhill/uBlock/issues/420 SelectorCacheEntry.prototype.remove = function(type) { this.lastAccessTime = Date.now(); - if ( type === 'cosmetic' ) { + if ( type === undefined || type === 'cosmetic' ) { this.cosmetic = {}; - } else { + } + if ( type === undefined || type === 'net' ) { this.net = {}; this.netCount = 0; } diff --git a/src/js/messaging.js b/src/js/messaging.js index e3cbeb4cd..22894d903 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -752,6 +752,9 @@ var onMessage = function(request, sender, callback) { break; case 'setSessionFirewallRules': + // https://github.com/gorhill/uBlock/issues/772 + µb.cosmeticFilteringEngine.removeFromSelectorCache('*'); + µb.sessionFirewall.fromString(request.rules); response = getFirewallRules(); break;