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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 { | 60 { |
61 page.browserAction.setBadge({ | 61 page.browserAction.setBadge({ |
62 color: badgeColor, | 62 color: badgeColor, |
63 number: blocked | 63 number: blocked |
64 }); | 64 }); |
65 } | 65 } |
66 }); | 66 }); |
67 | 67 |
68 Prefs.on("show_statsinicon", () => | 68 Prefs.on("show_statsinicon", () => |
69 { | 69 { |
70 ext.pages.query({}, pages => | 70 chrome.tabs.query({}, tabs => |
71 { | 71 { |
72 for (let page of pages) | 72 for (let tab of tabs) |
73 { | 73 { |
| 74 let page = new ext.Page(tab); |
74 let badge = null; | 75 let badge = null; |
75 | 76 |
76 if (Prefs.show_statsinicon) | 77 if (Prefs.show_statsinicon) |
77 { | 78 { |
78 let blocked = blockedPerPage.get(page); | 79 let blocked = blockedPerPage.get(page); |
79 if (blocked) | 80 if (blocked) |
80 { | 81 { |
81 badge = { | 82 badge = { |
82 color: badgeColor, | 83 color: badgeColor, |
83 number: blocked | 84 number: blocked |
84 }; | 85 }; |
85 } | 86 } |
86 } | 87 } |
87 | 88 |
88 page.browserAction.setBadge(badge); | 89 page.browserAction.setBadge(badge); |
89 } | 90 } |
90 }); | 91 }); |
91 }); | 92 }); |
92 | 93 |
93 port.on("stats.getBlockedPerPage", | 94 port.on("stats.getBlockedPerPage", |
94 message => getBlockedPerPage(new ext.Page(message.tab))); | 95 message => getBlockedPerPage(new ext.Page(message.tab))); |
OLD | NEW |