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

Side by Side Diff: lib/subscriptionInit.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use browser object directly when available Created Oct. 11, 2017, 10:58 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/stats.js ('k') | lib/uninstall.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 for (let subscription of subscriptions) 199 for (let subscription of subscriptions)
200 { 200 {
201 FilterStorage.addSubscription(subscription); 201 FilterStorage.addSubscription(subscription);
202 if (subscription instanceof DownloadableSubscription && 202 if (subscription instanceof DownloadableSubscription &&
203 !subscription.lastDownload) 203 !subscription.lastDownload)
204 Synchronizer.execute(subscription); 204 Synchronizer.execute(subscription);
205 } 205 }
206 206
207 if (firstRun && !Prefs.suppress_first_run_page) 207 if (firstRun && !Prefs.suppress_first_run_page)
208 chrome.tabs.create({url: ext.getURL("firstRun.html")}); 208 browser.tabs.create({url: ext.getURL("firstRun.html")});
209 209
210 initNotifications(); 210 initNotifications();
211 } 211 }
212 212
213 Promise.all([FilterNotifier.once("load"), 213 Promise.all([FilterNotifier.once("load"),
214 Prefs.untilLoaded]).then(detectFirstRun) 214 Prefs.untilLoaded]).then(detectFirstRun)
215 .then(getSubscriptions) 215 .then(getSubscriptions)
216 .then(finishInitialization); 216 .then(finishInitialization);
217 217
218 /** 218 /**
219 * Indicates whether the default filter subscriptions have been added 219 * Indicates whether the default filter subscriptions have been added
220 * again because there weren't any subscriptions even though this wasn't 220 * again because there weren't any subscriptions even though this wasn't
221 * the first run. 221 * the first run.
222 * 222 *
223 * @type {boolean} 223 * @type {boolean}
224 */ 224 */
225 exports.reinitialized = false; 225 exports.reinitialized = false;
226 226
227 /** 227 /**
228 * Sets a callback that is called with an array of subscriptions to be added 228 * Sets a callback that is called with an array of subscriptions to be added
229 * during initialization. The callback must return an array of subscriptions 229 * during initialization. The callback must return an array of subscriptions
230 * that will effectively be added. 230 * that will effectively be added.
231 * 231 *
232 * @param {function} callback 232 * @param {function} callback
233 */ 233 */
234 exports.setSubscriptionsCallback = callback => 234 exports.setSubscriptionsCallback = callback =>
235 { 235 {
236 subscriptionsCallback = callback; 236 subscriptionsCallback = callback;
237 }; 237 };
OLDNEW
« no previous file with comments | « lib/stats.js ('k') | lib/uninstall.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld