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

Unified Diff: webrequest.js

Issue 8691076: Make sure to indicate to Chrome when our filters change (Closed)
Patch Set: Created Oct. 29, 2012, noon
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -14,16 +14,32 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]);
chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["http://*/*", "https://*/*"]}, ["responseHeaders"]);
chrome.tabs.onRemoved.addListener(forgetTab);
+var importantNotifications = {
+ 'filter.added': true,
+ 'filter.removed': true,
+ 'filter.disabled': true,
+ 'subscription.added': true,
+ 'subscription.removed': true,
+ 'subscription.disabled': true,
+ 'subscription.updated': true,
+ 'load': true
+};
+require("filterNotifier").FilterNotifier.addListener(function(action)
+{
+ if (action in importantNotifications)
+ chrome.webRequest.handlerBehaviorChanged();
Thomas Greiner 2012/10/29 16:40:16 according to the docs we shouldn't call it too oft
+});
+
var frames = {};
function onBeforeRequest(details)
{
if (details.tabId == -1)
return {};
var type = details.type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld