From 58b54cf9f960806f16cacdfe12594591f680fa3c Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 11 Feb 2015 17:28:19 -0500 Subject: [PATCH] this fixes #772 --- src/js/cosmetic-filtering.js | 5 +++-- src/js/messaging.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) 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;