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

Delta Between Two Patch Sets: lib/antiadblockInit.js

Issue 29370594: [adblockplusui] Issue 4915 - Define ext for background pages in antiadblockInit.js (Closed)
Left Patch Set: Define ext for background page in antiadblockInit Created Feb. 20, 2017, 1:46 p.m.
Right Patch Set: Use simple if instead of ternary operator Created March 3, 2017, 9:24 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 Cu.import("resource://gre/modules/Services.jsm"); 18 Cu.import("resource://gre/modules/Services.jsm");
19 19
20 let {Utils} = require("utils"); 20 let {Utils} = require("utils");
21 let {Prefs} = require("prefs"); 21 let {Prefs} = require("prefs");
22 let {ActiveFilter} = require("filterClasses"); 22 let {ActiveFilter} = require("filterClasses");
23 let {FilterStorage} = require("filterStorage"); 23 let {FilterStorage} = require("filterStorage");
24 let {FilterNotifier} = require("filterNotifier"); 24 let {FilterNotifier} = require("filterNotifier");
25 let {Subscription} = require("subscriptionClasses"); 25 let {Subscription} = require("subscriptionClasses");
26 let {Notification} = require("notification"); 26 let {Notification} = require("notification");
27 27
28 let ext = ( 28 let ext;
29 typeof window != "undefined" && window.ext ? 29 if (typeof window != "undefined" && window.ext)
30 window.ext : 30 ext = window.ext;
31 require("ext_background") 31 else
32 ); 32 ext = require("ext_background");
Sebastian Noack 2017/02/20 16:27:25 For reference, if it wouldn't be for ESLint's non-
wspee 2017/03/01 14:53:38 Done.
Wladimir Palant 2017/03/02 11:14:39 That wouldn't work, ESLint isn't spoiling the fun
33 33
34 exports.initAntiAdblockNotification = function initAntiAdblockNotification() 34 exports.initAntiAdblockNotification = function initAntiAdblockNotification()
35 { 35 {
36 let notification = { 36 let notification = {
37 id: "antiadblock", 37 id: "antiadblock",
38 type: "question", 38 type: "question",
39 title: ext.i18n.getMessage("notification_antiadblock_title"), 39 title: ext.i18n.getMessage("notification_antiadblock_title"),
40 message: ext.i18n.getMessage("notification_antiadblock_message"), 40 message: ext.i18n.getMessage("notification_antiadblock_message"),
41 urlFilters: [] 41 urlFilters: []
42 }; 42 };
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 if (url in FilterStorage.knownSubscriptions && !subscription.disabled) 87 if (url in FilterStorage.knownSubscriptions && !subscription.disabled)
88 addAntiAdblockNotification(subscription); 88 addAntiAdblockNotification(subscription);
89 else 89 else
90 removeAntiAdblockNotification(); 90 removeAntiAdblockNotification();
91 } 91 }
92 92
93 FilterNotifier.on("subscription.updated", onSubscriptionChange); 93 FilterNotifier.on("subscription.updated", onSubscriptionChange);
94 FilterNotifier.on("subscription.removed", onSubscriptionChange); 94 FilterNotifier.on("subscription.removed", onSubscriptionChange);
95 FilterNotifier.on("subscription.disabled", onSubscriptionChange); 95 FilterNotifier.on("subscription.disabled", onSubscriptionChange);
96 } 96 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld