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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Update stats | 87 // Update stats |
88 ext.pages.query({active: true, lastFocusedWindow: true}, pages => | 88 ext.pages.query({active: true, lastFocusedWindow: true}, pages => |
89 { | 89 { |
90 currentPage = pages[0]; | 90 currentPage = pages[0]; |
91 updateStats(); | 91 updateStats(); |
92 | 92 |
93 FilterNotifier.on("filter.hitCount", updateStats); | 93 FilterNotifier.on("filter.hitCount", updateStats); |
94 | 94 |
95 document.getElementById("stats-container").removeAttribute("hidden"); | 95 document.getElementById("stats-container").removeAttribute("hidden"); |
96 }); | 96 }); |
| 97 |
| 98 document.removeEventListener("DOMContentLoaded", onLoad); |
97 } | 99 } |
98 | 100 |
99 function onUnload() | 101 function onUnload() |
100 { | 102 { |
101 FilterNotifier.off("filter.hitCount", updateStats); | 103 FilterNotifier.off("filter.hitCount", updateStats); |
102 } | 104 } |
103 | 105 |
104 function updateStats() | 106 function updateStats() |
105 { | 107 { |
106 let statsPage = document.getElementById("stats-page"); | 108 let statsPage = document.getElementById("stats-page"); |
(...skipping 21 matching lines...) Expand all Loading... |
128 { | 130 { |
129 Prefs.show_statsinicon = !Prefs.show_statsinicon; | 131 Prefs.show_statsinicon = !Prefs.show_statsinicon; |
130 document.getElementById("show-iconnumber").setAttribute( | 132 document.getElementById("show-iconnumber").setAttribute( |
131 "aria-checked", Prefs.show_statsinicon | 133 "aria-checked", Prefs.show_statsinicon |
132 ); | 134 ); |
133 } | 135 } |
134 | 136 |
135 document.addEventListener("DOMContentLoaded", onLoad, false); | 137 document.addEventListener("DOMContentLoaded", onLoad, false); |
136 window.addEventListener("unload", onUnload, false); | 138 window.addEventListener("unload", onUnload, false); |
137 }()); | 139 }()); |
OLD | NEW |