| OLD | NEW |
| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 subscriptions = subscriptionsCallback(subscriptions); | 231 subscriptions = subscriptionsCallback(subscriptions); |
| 232 | 232 |
| 233 for (let subscription of subscriptions) | 233 for (let subscription of subscriptions) |
| 234 { | 234 { |
| 235 FilterStorage.addSubscription(subscription); | 235 FilterStorage.addSubscription(subscription); |
| 236 if (subscription instanceof DownloadableSubscription && | 236 if (subscription instanceof DownloadableSubscription && |
| 237 !subscription.lastDownload) | 237 !subscription.lastDownload) |
| 238 Synchronizer.execute(subscription); | 238 Synchronizer.execute(subscription); |
| 239 } | 239 } |
| 240 | 240 |
| 241 if (!Prefs.suppress_first_run_page) | 241 if (!Prefs.suppress_first_run_page && firstRun) |
| 242 { | 242 { |
| 243 let page = null; | 243 browser.tabs.create({url: browser.extension.getURL("firstRun.html")}); |
| 244 if (firstRun) | |
| 245 { | |
| 246 page = "firstRun.html"; | |
| 247 } | |
| 248 // For now we're limiting the updates page to users of | |
| 249 // Chromium-based browsers to gage its impact | |
| 250 else if (info.platform == "chromium" && | |
| 251 updatesVersion > Prefs.last_updates_page_displayed) | |
| 252 { | |
| 253 page = "updates.html"; | |
| 254 } | |
| 255 | |
| 256 if (page) | |
| 257 { | |
| 258 browser.tabs.create({url: browser.extension.getURL(page)}); | |
| 259 | |
| 260 // For new users and users that have already seen this updates page we | |
| 261 // want to avoid showing it again for subsequent updates. | |
| 262 Prefs.last_updates_page_displayed = updatesVersion; | |
| 263 } | |
| 264 } | 244 } |
| 265 | 245 |
| 266 initNotifications(); | 246 initNotifications(); |
| 267 } | 247 } |
| 268 | 248 |
| 269 Promise.all([FilterNotifier.once("load"), | 249 Promise.all([FilterNotifier.once("load"), |
| 270 Prefs.untilLoaded]).then(detectFirstRun) | 250 Prefs.untilLoaded]).then(detectFirstRun) |
| 271 .then(getSubscriptions) | 251 .then(getSubscriptions) |
| 272 .then(finishInitialization); | 252 .then(finishInitialization); |
| 273 | 253 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 284 * Sets a callback that is called with an array of subscriptions to be added | 264 * Sets a callback that is called with an array of subscriptions to be added |
| 285 * during initialization. The callback must return an array of subscriptions | 265 * during initialization. The callback must return an array of subscriptions |
| 286 * that will effectively be added. | 266 * that will effectively be added. |
| 287 * | 267 * |
| 288 * @param {function} callback | 268 * @param {function} callback |
| 289 */ | 269 */ |
| 290 exports.setSubscriptionsCallback = callback => | 270 exports.setSubscriptionsCallback = callback => |
| 291 { | 271 { |
| 292 subscriptionsCallback = callback; | 272 subscriptionsCallback = callback; |
| 293 }; | 273 }; |
| OLD | NEW |