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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 { | 357 { |
358 if (activeNotification && activeNotification.id === notification.id) | 358 if (activeNotification && activeNotification.id === notification.id) |
359 return; | 359 return; |
360 | 360 |
361 activeNotification = notification; | 361 activeNotification = notification; |
362 if (activeNotification.type === "critical" || activeNotification.type === "que
stion") | 362 if (activeNotification.type === "critical" || activeNotification.type === "que
stion") |
363 { | 363 { |
364 var texts = NotificationStorage.getLocalizedTexts(notification); | 364 var texts = NotificationStorage.getLocalizedTexts(notification); |
365 var title = texts.title || ""; | 365 var title = texts.title || ""; |
366 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "")
: ""; | 366 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "")
: ""; |
367 var iconUrl = ext.getURL("icons/abp-128.png"); | 367 var iconUrl = ext.getURL("icons/detailed/abp-128.png"); |
368 var hasLinks = activeNotification.links && activeNotification.links.length >
0; | 368 var hasLinks = activeNotification.links && activeNotification.links.length >
0; |
369 | 369 |
370 if (canUseChromeNotifications) | 370 if (canUseChromeNotifications) |
371 { | 371 { |
372 var opts = { | 372 var opts = { |
373 type: "basic", | 373 type: "basic", |
374 title: title, | 374 title: title, |
375 message: message, | 375 message: message, |
376 buttons: [], | 376 buttons: [], |
377 priority: 2 // We use the highest priority to prevent the notification f
rom closing automatically | 377 priority: 2 // We use the highest priority to prevent the notification f
rom closing automatically |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 page.sendMessage({type: "clickhide-deactivate"}); | 577 page.sendMessage({type: "clickhide-deactivate"}); |
578 refreshIconAndContextMenu(page); | 578 refreshIconAndContextMenu(page); |
579 }); | 579 }); |
580 | 580 |
581 setTimeout(function() | 581 setTimeout(function() |
582 { | 582 { |
583 var notificationToShow = NotificationStorage.getNextToShow(); | 583 var notificationToShow = NotificationStorage.getNextToShow(); |
584 if (notificationToShow) | 584 if (notificationToShow) |
585 showNotification(notificationToShow); | 585 showNotification(notificationToShow); |
586 }, 3 * 60 * 1000); | 586 }, 3 * 60 * 1000); |
OLD | NEW |