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-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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 }); | 77 }); |
78 } | 78 } |
79 } | 79 } |
80 }); | 80 }); |
81 | 81 |
82 Prefs.addListener(function(name) | 82 Prefs.addListener(function(name) |
83 { | 83 { |
84 if (name != "show_statsinicon") | 84 if (name != "show_statsinicon") |
85 return; | 85 return; |
86 | 86 |
87 ext.pages.query({}, function(page) | 87 ext.pages.query({}, function(pages) |
88 { | 88 { |
89 let badge = null; | 89 for (var i = 0; i < pages.length; i++) |
90 if (Prefs.show_statsinicon) | |
91 { | 90 { |
92 let pageStats = statsPerPage.get(page); | 91 let page = pages[i]; |
93 if (pageStats && "blocked" in pageStats) | 92 let badge = null; |
| 93 |
| 94 if (Prefs.show_statsinicon) |
94 { | 95 { |
95 badge = { | 96 let pageStats = statsPerPage.get(page); |
96 color: badgeColor, | 97 if (pageStats && "blocked" in pageStats) |
97 number: pageStats.blocked | 98 { |
98 }; | 99 badge = { |
| 100 color: badgeColor, |
| 101 number: pageStats.blocked |
| 102 }; |
| 103 } |
99 } | 104 } |
| 105 |
| 106 page.browserAction.setBadge(badge); |
100 } | 107 } |
101 page.browserAction.setBadge(badge); | |
102 }); | 108 }); |
103 }); | 109 }); |
OLD | NEW |