Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: background.js

Issue 29338534: Issue 3826 - Filter preference change events (Closed)
Patch Set: Rebased and fixed a typo Created March 19, 2016, 7:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/events.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | lib/events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld