| LEFT | RIGHT |
| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 type: "question", | 57 type: "question", |
| 58 title: ext.i18n.getMessage("overlay_notification_button_yes") | 58 title: ext.i18n.getMessage("overlay_notification_button_yes") |
| 59 }); | 59 }); |
| 60 buttons.push({ | 60 buttons.push({ |
| 61 type: "question", | 61 type: "question", |
| 62 title: ext.i18n.getMessage("overlay_notification_button_no") | 62 title: ext.i18n.getMessage("overlay_notification_button_no") |
| 63 }); | 63 }); |
| 64 } | 64 } |
| 65 else | 65 else |
| 66 { | 66 { |
| 67 const regex = /<a>(.*?)<\/a>/g; | 67 let regex = /<a>(.*?)<\/a>/g; |
| 68 let match; | 68 let match; |
| 69 while (match = regex.exec(message)) | 69 while (match = regex.exec(message)) |
| 70 { | 70 { |
| 71 buttons.push({ | 71 buttons.push({ |
| 72 type: "link", | 72 type: "link", |
| 73 title: match[1] | 73 title: match[1] |
| 74 }); | 74 }); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Chrome only allows two notification buttons so we need to fall back | 77 // Chrome only allows two notification buttons so we need to fall back |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 let methods = displayMethods[notificationType] || defaultDisplayMethods; | 259 let methods = displayMethods[notificationType] || defaultDisplayMethods; |
| 260 return methods.indexOf(method) > -1; | 260 return methods.indexOf(method) > -1; |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 ext.pages.onLoading.addListener(page => | 263 ext.pages.onLoading.addListener(page => |
| 264 { | 264 { |
| 265 NotificationStorage.showNext(stringifyURL(page.url)); | 265 NotificationStorage.showNext(stringifyURL(page.url)); |
| 266 }); | 266 }); |
| 267 | 267 |
| 268 NotificationStorage.addShowListener(showNotification); | 268 NotificationStorage.addShowListener(showNotification); |
| LEFT | RIGHT |