Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/antiadblockInit.js

Issue 29375899: Issue 4871 - Start using ESLint for adblockplusui (Closed)
Patch Set: Remove the arrow-parens rule Created March 9, 2017, 10:29 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 */
Wladimir Palant 2017/03/09 15:05:08 This global is actually common to all our CommonJS
kzar 2017/03/10 07:29:00 Done.
+
+"use strict";
+
Cu.import("resource://gre/modules/Services.jsm");
let {Utils} = require("utils");
kzar 2017/03/10 07:29:00 ESLint was complaining this was unused so I've rem
@@ -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);
-}
+};

Powered by Google App Engine
This is Rietveld