| 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 |
| 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 /** @module notificationHelper */ | 18 /** @module notificationHelper */ |
| 19 | 19 |
| 20 "use strict"; | 20 "use strict"; |
| 21 | 21 |
| 22 const {startIconAnimation, stopIconAnimation} = require("icon"); | 22 const {startIconAnimation, stopIconAnimation} = require("./icon"); |
| 23 const {Utils} = require("utils"); | 23 const {Utils} = require("./utils"); |
| 24 const {Notification: NotificationStorage} = require("notification"); | 24 const {Notification: NotificationStorage} = require( |
| 25 const {stringifyURL} = require("url"); | 25 "../adblockpluscore/lib/notification"); |
| 26 const {initAntiAdblockNotification} = require("antiadblockInit"); | 26 const {stringifyURL} = require("./url"); |
| 27 const {Prefs} = require("prefs"); | 27 const {initAntiAdblockNotification} = require( |
| 28 const {showOptions} = require("options"); | 28 "../adblockplusui/lib/antiadblockInit"); |
| 29 const {Prefs} = require("./prefs"); |
| 30 const {showOptions} = require("./options"); |
| 29 | 31 |
| 30 let activeNotification = null; | 32 let activeNotification = null; |
| 31 let activeButtons = null; | 33 let activeButtons = null; |
| 32 let defaultDisplayMethods = ["popup"]; | 34 let defaultDisplayMethods = ["popup"]; |
| 33 let displayMethods = Object.create(null); | 35 let displayMethods = Object.create(null); |
| 34 displayMethods.critical = ["icon", "notification", "popup"]; | 36 displayMethods.critical = ["icon", "notification", "popup"]; |
| 35 displayMethods.question = ["notification"]; | 37 displayMethods.question = ["notification"]; |
| 36 displayMethods.normal = ["notification"]; | 38 displayMethods.normal = ["notification"]; |
| 37 displayMethods.relentless = ["notification"]; | 39 displayMethods.relentless = ["notification"]; |
| 38 displayMethods.information = ["icon", "popup"]; | 40 displayMethods.information = ["icon", "popup"]; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 let methods = displayMethods[notificationType] || defaultDisplayMethods; | 295 let methods = displayMethods[notificationType] || defaultDisplayMethods; |
| 294 return methods.includes(method); | 296 return methods.includes(method); |
| 295 }; | 297 }; |
| 296 | 298 |
| 297 ext.pages.onLoading.addListener(page => | 299 ext.pages.onLoading.addListener(page => |
| 298 { | 300 { |
| 299 NotificationStorage.showNext(stringifyURL(page.url)); | 301 NotificationStorage.showNext(stringifyURL(page.url)); |
| 300 }); | 302 }); |
| 301 | 303 |
| 302 NotificationStorage.addShowListener(showNotification); | 304 NotificationStorage.addShowListener(showNotification); |
| OLD | NEW |