Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 notification.show(); | 340 notification.show(); |
341 notification.addEventListener("close", prepareNotificationIconAndPopup, fa lse); | 341 notification.addEventListener("close", prepareNotificationIconAndPopup, fa lse); |
342 return; | 342 return; |
343 } | 343 } |
344 | 344 |
345 var texts = Notification.getLocalizedTexts(notification); | 345 var texts = Notification.getLocalizedTexts(notification); |
346 var title = texts.title || ""; | 346 var title = texts.title || ""; |
347 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "") : ""; | 347 var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "") : ""; |
348 var iconUrl = ext.getURL("icons/abp-128.png"); | 348 var iconUrl = ext.getURL("icons/abp-128.png"); |
349 var hasLinks = activeNotification.links && activeNotification.links.length > 0; | 349 var hasLinks = activeNotification.links && activeNotification.links.length > 0; |
350 // Chrome on Linux does not fully support chrome.notifications yet ( https:/ /code.google.com/p/chromium/issues/detail?id=291485 ) | 350 // Chrome on Linux does not fully support chrome.notifications yet |
351 if (require("info").platform == "chromium" && "notifications" in chrome && n avigator.platform.indexOf("Linux") == -1) | 351 // https://code.google.com/p/chromium/issues/detail?id=291485 |
Sebastian Noack
2014/03/06 09:58:31
Nit: Those are two very long lines. We usually try
saroyanm
2014/03/06 10:11:15
Will keep in mind,thanks.
Done.
| |
352 if (require("info").platform == "chromium" && | |
353 "notifications" in chrome && | |
354 navigator.platform.indexOf("Linux") == -1) | |
352 { | 355 { |
353 var opts = { | 356 var opts = { |
354 type: "basic", | 357 type: "basic", |
355 title: title, | 358 title: title, |
356 message: message, | 359 message: message, |
357 iconUrl: iconUrl, | 360 iconUrl: iconUrl, |
358 buttons: [] | 361 buttons: [] |
359 }; | 362 }; |
360 var regex = /<a>(.*?)<\/a>/g; | 363 var regex = /<a>(.*?)<\/a>/g; |
361 var plainMessage = texts.message || ""; | 364 var plainMessage = texts.message || ""; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
493 tab.sendMessage({type: "clickhide-deactivate"}); | 496 tab.sendMessage({type: "clickhide-deactivate"}); |
494 refreshIconAndContextMenu(tab); | 497 refreshIconAndContextMenu(tab); |
495 }); | 498 }); |
496 | 499 |
497 setTimeout(function() | 500 setTimeout(function() |
498 { | 501 { |
499 var notificationToShow = Notification.getNextToShow(); | 502 var notificationToShow = Notification.getNextToShow(); |
500 if (notificationToShow) | 503 if (notificationToShow) |
501 showNotification(notificationToShow); | 504 showNotification(notificationToShow); |
502 }, 3 * 60 * 1000); | 505 }, 3 * 60 * 1000); |
LEFT | RIGHT |