Index: lib/antiadblockInit.js |
=================================================================== |
--- a/lib/antiadblockInit.js |
+++ b/lib/antiadblockInit.js |
@@ -72,14 +72,19 @@ |
if (subscription.lastDownload && subscription.disabled) |
addAntiAdblockNotification(subscription); |
- FilterNotifier.addListener(function(action, value, newItem, oldItem) |
+ function onSubscriptionChange(subscription) |
{ |
- if (!/^subscription\.(updated|removed|disabled)$/.test(action) || value.url != Prefs.subscriptions_antiadblockurl) |
+ let url = Prefs.subscriptions_antiadblockurl; |
+ if (url != subscription.url) |
return; |
- if (action == "subscription.updated") |
- addAntiAdblockNotification(value); |
- else if (action == "subscription.removed" || (action == "subscription.disabled" && !value.disabled)) |
+ if (url in FilterStorage.knownSubscriptions && !subscription.disabled) |
+ addAntiAdblockNotification(subscription); |
+ else |
removeAntiAdblockNotification(); |
- }); |
+ } |
+ |
+ FilterNotifier.on("subscription.updated", onSubscriptionChange); |
+ FilterNotifier.on("subscription.removed", onSubscriptionChange); |
+ FilterNotifier.on("subscription.disabled", onSubscriptionChange); |
} |