OLD | NEW |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 // Remove deprecated options before we do anything else. | 98 // Remove deprecated options before we do anything else. |
99 removeDeprecatedOptions(); | 99 removeDeprecatedOptions(); |
100 | 100 |
101 var activeNotification = null; | 101 var activeNotification = null; |
102 | 102 |
103 // Adds or removes browser action icon according to options. | 103 // Adds or removes browser action icon according to options. |
104 function refreshIconAndContextMenu(tab) | 104 function refreshIconAndContextMenu(tab) |
105 { | 105 { |
106 if(!/^https?:/.test(tab.url)) | |
107 return; | |
108 | |
109 var iconFilename; | 106 var iconFilename; |
110 if (require("info").platform == "safari") | 107 if (require("info").platform == "safari") |
111 // There is no grayscale version of the icon for whitelisted tabs | 108 // There is no grayscale version of the icon for whitelisted tabs |
112 // when using Safari, because icons are grayscale already and icons | 109 // when using Safari, because icons are grayscale already and icons |
113 // aren't per tab in Safari. | 110 // aren't per tab in Safari. |
114 iconFilename = "icons/abp-16.png" | 111 iconFilename = "icons/abp-16.png" |
115 else | 112 else |
116 { | 113 { |
117 var excluded = isWhitelisted(tab.url); | 114 var excluded = isWhitelisted(tab.url); |
118 iconFilename = excluded ? "icons/abp-19-whitelisted.png" : "icons/abp-19.png
"; | 115 iconFilename = excluded ? "icons/abp-19-whitelisted.png" : "icons/abp-19.png
"; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 tab.sendMessage({type: "clickhide-deactivate"}); | 420 tab.sendMessage({type: "clickhide-deactivate"}); |
424 refreshIconAndContextMenu(tab); | 421 refreshIconAndContextMenu(tab); |
425 }); | 422 }); |
426 | 423 |
427 setTimeout(function() | 424 setTimeout(function() |
428 { | 425 { |
429 var notificationToShow = Notification.getNextToShow(); | 426 var notificationToShow = Notification.getNextToShow(); |
430 if (notificationToShow) | 427 if (notificationToShow) |
431 showNotification(notificationToShow); | 428 showNotification(notificationToShow); |
432 }, 3 * 60 * 1000); | 429 }, 3 * 60 * 1000); |
OLD | NEW |