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

Side by Side Diff: lib/whitelisting.js

Issue 29569615: Noissue - Replace ext.pages.query with tabs.query (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Oct. 8, 2017, 11:37 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 | « lib/stats.js ('k') | no next file » | 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 function revalidateWhitelistingState(page) 126 function revalidateWhitelistingState(page)
127 { 127 {
128 FilterNotifier.emit( 128 FilterNotifier.emit(
129 "page.WhitelistingStateRevalidate", 129 "page.WhitelistingStateRevalidate",
130 page, checkWhitelisted(page) 130 page, checkWhitelisted(page)
131 ); 131 );
132 } 132 }
133 133
134 FilterNotifier.on("filter.behaviorChanged", () => 134 FilterNotifier.on("filter.behaviorChanged", () =>
135 { 135 {
136 ext.pages.query({}, pages => 136 chrome.tabs.query({}, tabs =>
137 { 137 {
138 for (let page of pages) 138 for (let tab of tabs)
139 revalidateWhitelistingState(page); 139 revalidateWhitelistingState(new ext.Page(tab));
140 }); 140 });
141 }); 141 });
142 142
143 ext.pages.onLoading.addListener(revalidateWhitelistingState); 143 ext.pages.onLoading.addListener(revalidateWhitelistingState);
144 144
145 let getKey = 145 let getKey =
146 /** 146 /**
147 * Gets the public key, previously recorded for the given page 147 * Gets the public key, previously recorded for the given page
148 * and frame, to be considered for the $sitekey filter option. 148 * and frame, to be considered for the $sitekey filter option.
149 * 149 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 { 225 {
226 chrome.webRequest.onHeadersReceived.addListener( 226 chrome.webRequest.onHeadersReceived.addListener(
227 onHeadersReceived, 227 onHeadersReceived,
228 { 228 {
229 urls: ["http://*/*", "https://*/*"], 229 urls: ["http://*/*", "https://*/*"],
230 types: ["main_frame", "sub_frame"] 230 types: ["main_frame", "sub_frame"]
231 }, 231 },
232 ["responseHeaders"] 232 ["responseHeaders"]
233 ); 233 );
234 } 234 }
OLDNEW
« no previous file with comments | « lib/stats.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld