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-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Adds or removes browser action icon according to options. | 114 // Adds or removes browser action icon according to options. |
115 function refreshIconAndContextMenu(tab) | 115 function refreshIconAndContextMenu(tab) |
116 { | 116 { |
117 var whitelisted = isWhitelisted(tab.url); | 117 var whitelisted = isWhitelisted(tab.url); |
118 | 118 |
119 var iconFilename; | 119 var iconFilename; |
120 if (whitelisted && require("info").platform != "safari") | 120 if (whitelisted && require("info").platform != "safari") |
121 // There is no grayscale version of the icon for whitelisted tabs | 121 // There is no grayscale version of the icon for whitelisted tabs |
122 // when using Safari, because icons are grayscale already and icons | 122 // when using Safari, because icons are grayscale already and icons |
123 // aren't per tab in Safari. | 123 // aren't per tab in Safari. |
124 iconFilename = "icons/abp-whitelisted.png"; | 124 iconFilename = "icons/abp-$size-whitelisted.png"; |
125 else | 125 else |
126 iconFilename = "icons/abp.png"; | 126 iconFilename = "icons/abp-$size.png"; |
127 | 127 |
128 tab.browserAction.setIcon(iconFilename); | 128 tab.browserAction.setIcon(iconFilename); |
129 iconAnimation.registerTab(tab, iconFilename); | 129 iconAnimation.registerTab(tab, iconFilename); |
130 | 130 |
131 // Set context menu status according to whether current tab has whitelisted do
main | 131 // Set context menu status according to whether current tab has whitelisted do
main |
132 if (whitelisted || !/^https?:/.test(tab.url)) | 132 if (whitelisted || !/^https?:/.test(tab.url)) |
133 ext.contextMenus.hideMenuItems(); | 133 ext.contextMenus.hideMenuItems(); |
134 else | 134 else |
135 ext.contextMenus.showMenuItems(); | 135 ext.contextMenus.showMenuItems(); |
136 } | 136 } |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 tab.sendMessage({type: "clickhide-deactivate"}); | 584 tab.sendMessage({type: "clickhide-deactivate"}); |
585 refreshIconAndContextMenu(tab); | 585 refreshIconAndContextMenu(tab); |
586 }); | 586 }); |
587 | 587 |
588 setTimeout(function() | 588 setTimeout(function() |
589 { | 589 { |
590 var notificationToShow = Notification.getNextToShow(); | 590 var notificationToShow = Notification.getNextToShow(); |
591 if (notificationToShow) | 591 if (notificationToShow) |
592 showNotification(notificationToShow); | 592 showNotification(notificationToShow); |
593 }, 3 * 60 * 1000); | 593 }, 3 * 60 * 1000); |
LEFT | RIGHT |