Index: webrequest.js |
=================================================================== |
--- a/webrequest.js |
+++ b/webrequest.js |
@@ -14,16 +14,32 @@ |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]); |
chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["http://*/*", "https://*/*"]}, ["responseHeaders"]); |
chrome.tabs.onRemoved.addListener(forgetTab); |
+var importantNotifications = { |
+ 'filter.added': true, |
+ 'filter.removed': true, |
+ 'filter.disabled': true, |
+ 'subscription.added': true, |
+ 'subscription.removed': true, |
+ 'subscription.disabled': true, |
+ 'subscription.updated': true, |
+ 'load': true |
+}; |
+require("filterNotifier").FilterNotifier.addListener(function(action) |
+{ |
+ if (action in importantNotifications) |
+ chrome.webRequest.handlerBehaviorChanged(); |
Thomas Greiner
2012/10/29 16:40:16
according to the docs we shouldn't call it too oft
|
+}); |
+ |
var frames = {}; |
function onBeforeRequest(details) |
{ |
if (details.tabId == -1) |
return {}; |
var type = details.type; |