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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 case "link": | 119 case "link": |
120 browser.tabs.create({ | 120 browser.tabs.create({ |
121 url: Utils.getDocLink(activeNotification.links[buttonIndex]) | 121 url: Utils.getDocLink(activeNotification.links[buttonIndex]) |
122 }); | 122 }); |
123 break; | 123 break; |
124 case "open-all": | 124 case "open-all": |
125 openNotificationLinks(); | 125 openNotificationLinks(); |
126 break; | 126 break; |
127 case "configure": | 127 case "configure": |
128 Prefs.notifications_showui = true; | 128 Prefs.notifications_showui = true; |
129 showOptions(page => | 129 showOptions((page, port) => |
130 { | 130 { |
131 page.sendMessage({ | 131 port.postMessage({ |
132 type: "app.respond", | 132 type: "app.respond", |
133 action: "focusSection", | 133 action: "focusSection", |
134 args: ["notifications"] | 134 args: ["notifications"] |
135 }); | 135 }); |
136 }); | 136 }); |
137 break; | 137 break; |
138 case "question": | 138 case "question": |
139 NotificationStorage.triggerQuestionListeners(activeNotification.id, | 139 NotificationStorage.triggerQuestionListeners(activeNotification.id, |
140 buttonIndex == 0); | 140 buttonIndex == 0); |
141 NotificationStorage.markAsShown(activeNotification.id); | 141 NotificationStorage.markAsShown(activeNotification.id); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 let methods = displayMethods[notificationType] || defaultDisplayMethods; | 293 let methods = displayMethods[notificationType] || defaultDisplayMethods; |
294 return methods.includes(method); | 294 return methods.includes(method); |
295 }; | 295 }; |
296 | 296 |
297 ext.pages.onLoading.addListener(page => | 297 ext.pages.onLoading.addListener(page => |
298 { | 298 { |
299 NotificationStorage.showNext(stringifyURL(page.url)); | 299 NotificationStorage.showNext(stringifyURL(page.url)); |
300 }); | 300 }); |
301 | 301 |
302 NotificationStorage.addShowListener(showNotification); | 302 NotificationStorage.addShowListener(showNotification); |
OLD | NEW |