Index: lib/antiadblockInit.js |
diff --git a/lib/antiadblockInit.js b/lib/antiadblockInit.js |
index e48039e27a250ecdc9c46c771c7a927e532b47a0..2b69f611d07ca983c1d9abf64b6897c5a66368ad 100644 |
--- a/lib/antiadblockInit.js |
+++ b/lib/antiadblockInit.js |
@@ -15,6 +15,10 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+/* globals Cu */ |
+ |
+"use strict"; |
+ |
Cu.import("resource://gre/modules/Services.jsm"); |
let {Utils} = require("utils"); |
@@ -27,7 +31,7 @@ let {Notification} = require("notification"); |
let ext; |
if (typeof window != "undefined" && window.ext) |
- ext = window.ext; |
+ ({ext} = window); |
else |
ext = require("ext_background"); |
@@ -58,7 +62,8 @@ exports.initAntiAdblockNotification = function initAntiAdblockNotification() |
for (let domain in filter.domains) |
{ |
let urlFilter = "||" + domain + "^$document"; |
- if (domain && filter.domains[domain] && urlFilters.indexOf(urlFilter) == -1) |
+ if (domain && filter.domains[domain] && |
+ urlFilters.indexOf(urlFilter) == -1) |
urlFilters.push(urlFilter); |
} |
} |
@@ -74,9 +79,11 @@ exports.initAntiAdblockNotification = function initAntiAdblockNotification() |
Notification.removeQuestionListener(notification.id, notificationListener); |
} |
- let subscription = Subscription.fromURL(Prefs.subscriptions_antiadblockurl); |
- if (subscription.lastDownload && subscription.disabled) |
- addAntiAdblockNotification(subscription); |
+ let antiAdblockSubscription = Subscription.fromURL( |
+ Prefs.subscriptions_antiadblockurl |
+ ); |
+ if (antiAdblockSubscription.lastDownload && antiAdblockSubscription.disabled) |
+ addAntiAdblockNotification(antiAdblockSubscription); |
function onSubscriptionChange(subscription) |
{ |
@@ -93,4 +100,4 @@ exports.initAntiAdblockNotification = function initAntiAdblockNotification() |
FilterNotifier.on("subscription.updated", onSubscriptionChange); |
FilterNotifier.on("subscription.removed", onSubscriptionChange); |
FilterNotifier.on("subscription.disabled", onSubscriptionChange); |
-} |
+}; |