| Left: | ||
| Right: |
| 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 22 matching lines...) Expand all Loading... | |
| 33 let defaultDisplayMethods = ["popup"]; | 33 let defaultDisplayMethods = ["popup"]; |
| 34 let displayMethods = Object.create(null); | 34 let displayMethods = Object.create(null); |
| 35 displayMethods.critical = ["icon", "notification", "popup"]; | 35 displayMethods.critical = ["icon", "notification", "popup"]; |
| 36 displayMethods.question = ["notification"]; | 36 displayMethods.question = ["notification"]; |
| 37 displayMethods.normal = ["notification"]; | 37 displayMethods.normal = ["notification"]; |
| 38 displayMethods.relentless = ["notification"]; | 38 displayMethods.relentless = ["notification"]; |
| 39 displayMethods.information = ["icon", "popup"]; | 39 displayMethods.information = ["icon", "popup"]; |
| 40 | 40 |
| 41 function prepareNotificationIconAndPopup() | 41 function prepareNotificationIconAndPopup() |
| 42 { | 42 { |
| 43 let animateIcon = shouldDisplay("icon", activeNotification.type); | 43 let animateIcon = !(activeNotification.urlFilters instanceof Array) && |
|
kzar
2018/11/20 20:20:42
Nit: I figure we could just check that `urlFilters
Thomas Greiner
2018/11/21 11:55:58
You're probably right. Given that this data is com
| |
| 44 shouldDisplay("icon", activeNotification.type); | |
| 44 activeNotification.onClicked = () => | 45 activeNotification.onClicked = () => |
| 45 { | 46 { |
| 46 if (animateIcon) | 47 if (animateIcon) |
| 47 stopIconAnimation(); | 48 stopIconAnimation(); |
| 48 notificationClosed(); | 49 notificationClosed(); |
| 49 }; | 50 }; |
| 50 if (animateIcon) | 51 if (animateIcon) |
| 51 startIconAnimation(activeNotification.type); | 52 startIconAnimation(activeNotification.type); |
| 52 } | 53 } |
| 53 | 54 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 if (activeNotification) | 311 if (activeNotification) |
| 311 activeNotification.onClicked(); | 312 activeNotification.onClicked(); |
| 312 }; | 313 }; |
| 313 | 314 |
| 314 ext.pages.onLoading.addListener(page => | 315 ext.pages.onLoading.addListener(page => |
| 315 { | 316 { |
| 316 NotificationStorage.showNext(page.url.href); | 317 NotificationStorage.showNext(page.url.href); |
| 317 }); | 318 }); |
| 318 | 319 |
| 319 NotificationStorage.addShowListener(showNotification); | 320 NotificationStorage.addShowListener(showNotification); |
| OLD | NEW |