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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 pages.forEach(refreshIconAndContextMenu); | 78 pages.forEach(refreshIconAndContextMenu); |
79 }); | 79 }); |
80 } | 80 } |
81 | 81 |
82 FilterNotifier.addListener(function(action) | 82 FilterNotifier.addListener(function(action) |
83 { | 83 { |
84 if (action == "load" || action == "save") | 84 if (action == "load" || action == "save") |
85 refreshIconAndContextMenuForAllPages(); | 85 refreshIconAndContextMenuForAllPages(); |
86 }); | 86 }); |
87 | 87 |
88 Prefs.onChanged.addListener(function(name) | 88 Prefs.on("shouldShowBlockElementMenu", refreshIconAndContextMenuForAllPages); |
89 { | |
90 if (name == "shouldShowBlockElementMenu") | |
91 refreshIconAndContextMenuForAllPages(); | |
92 }); | |
93 | 89 |
94 // This is a hack to speedup loading of the options page on Safari. | 90 // This is a hack to speedup loading of the options page on Safari. |
95 // Once we replaced the background page proxy with message passing | 91 // Once we replaced the background page proxy with message passing |
96 // this global function should removed. | 92 // this global function should removed. |
97 function getUserFilters() | 93 function getUserFilters() |
98 { | 94 { |
99 var filters = []; | 95 var filters = []; |
100 var exceptions = []; | 96 var exceptions = []; |
101 | 97 |
102 for (var i = 0; i < FilterStorage.subscriptions.length; i++) | 98 for (var i = 0; i < FilterStorage.subscriptions.length; i++) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 208 } |
213 }); | 209 }); |
214 | 210 |
215 // update icon when page changes location | 211 // update icon when page changes location |
216 ext.pages.onLoading.addListener(function(page) | 212 ext.pages.onLoading.addListener(function(page) |
217 { | 213 { |
218 page.sendMessage({type: "composer.content.finished"}); | 214 page.sendMessage({type: "composer.content.finished"}); |
219 refreshIconAndContextMenu(page); | 215 refreshIconAndContextMenu(page); |
220 showNextNotificationForUrl(page.url); | 216 showNextNotificationForUrl(page.url); |
221 }); | 217 }); |
OLD | NEW |