| 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} = | 24 const {Notification: NotificationStorage} = |
| 25 require("../adblockpluscore/lib/notification"); | 25 require("../adblockpluscore/lib/notification"); |
| 26 const {stringifyURL} = require("./url"); | |
| 27 const {initAntiAdblockNotification} = | 26 const {initAntiAdblockNotification} = |
| 28 require("../adblockplusui/lib/antiadblockInit"); | 27 require("../adblockplusui/lib/antiadblockInit"); |
| 29 const {Prefs} = require("./prefs"); | 28 const {Prefs} = require("./prefs"); |
| 30 const {showOptions} = require("./options"); | 29 const {showOptions} = require("./options"); |
| 31 | 30 |
| 32 let activeNotification = null; | 31 let activeNotification = null; |
| 33 let activeButtons = null; | 32 let activeButtons = null; |
| 34 let defaultDisplayMethods = ["popup"]; | 33 let defaultDisplayMethods = ["popup"]; |
| 35 let displayMethods = Object.create(null); | 34 let displayMethods = Object.create(null); |
| 36 displayMethods.critical = ["icon", "notification", "popup"]; | 35 displayMethods.critical = ["icon", "notification", "popup"]; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 * Tidies up after a notification was clicked. | 306 * Tidies up after a notification was clicked. |
| 308 */ | 307 */ |
| 309 exports.notificationClicked = () => | 308 exports.notificationClicked = () => |
| 310 { | 309 { |
| 311 if (activeNotification) | 310 if (activeNotification) |
| 312 activeNotification.onClicked(); | 311 activeNotification.onClicked(); |
| 313 }; | 312 }; |
| 314 | 313 |
| 315 ext.pages.onLoading.addListener(page => | 314 ext.pages.onLoading.addListener(page => |
| 316 { | 315 { |
| 317 NotificationStorage.showNext(stringifyURL(page.url)); | 316 NotificationStorage.showNext(page.url.href); |
| 318 }); | 317 }); |
| 319 | 318 |
| 320 NotificationStorage.addShowListener(showNotification); | 319 NotificationStorage.addShowListener(showNotification); |
| OLD | NEW |