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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 function setIcon(page, notificationType, opacity, frames) | 51 function setIcon(page, notificationType, opacity, frames) |
52 { | 52 { |
53 opacity = opacity || 0; | 53 opacity = opacity || 0; |
54 let whitelisted = !!whitelistedState.get(page); | 54 let whitelisted = !!whitelistedState.get(page); |
55 | 55 |
56 if (!notificationType || !frames) | 56 if (!notificationType || !frames) |
57 { | 57 { |
58 if (opacity > 0.5) | 58 if (opacity > 0.5) |
59 { | 59 { |
60 page.browserAction.setIcon("icons/abp-$size-notification-" + | 60 page.browserAction.setIcon("/icons/abp-$size-notification-" + |
61 notificationType + ".png"); | 61 notificationType + ".png"); |
62 } | 62 } |
63 else | 63 else |
64 { | 64 { |
65 page.browserAction.setIcon("icons/abp-$size" + | 65 page.browserAction.setIcon("/icons/abp-$size" + |
66 (whitelisted ? "-whitelisted" : "") + ".png"); | 66 (whitelisted ? "-whitelisted" : "") + ".png"); |
67 } | 67 } |
68 } | 68 } |
69 else | 69 else |
70 { | 70 { |
71 chrome.browserAction.setIcon({ | 71 chrome.browserAction.setIcon({ |
72 tabId: page.id, | 72 tabId: page.id, |
73 imageData: frames["" + opacity + whitelisted] | 73 imageData: frames["" + opacity + whitelisted] |
74 }); | 74 }); |
75 } | 75 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 clearInterval(interval); | 228 clearInterval(interval); |
229 resolve(); | 229 resolve(); |
230 return; | 230 return; |
231 } | 231 } |
232 | 232 |
233 animateIcon(type, frames); | 233 animateIcon(type, frames); |
234 }, 10000); | 234 }, 10000); |
235 }); | 235 }); |
236 }); | 236 }); |
237 }; | 237 }; |
OLD | NEW |