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

Delta Between Two Patch Sets: lib/whitelisting.js

Issue 29532767: Issue 5593 - Use messaging in popup for prefs, whitelisting, and stats (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Change whitelisting calls to use messaging Created Sept. 21, 2017, 7:54 a.m.
Right Patch Set: Revert one more instance of ext.pages.open Created Sept. 27, 2017, 9:40 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/stats.js ('k') | notification.js » ('j') | stats.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 filter = match(page, frame.url, typeMask, docDomain, sitekey); 81 filter = match(page, frame.url, typeMask, docDomain, sitekey);
82 frame = parent; 82 frame = parent;
83 } 83 }
84 84
85 return filter; 85 return filter;
86 } 86 }
87 87
88 return match(page, page.url, typeMask); 88 return match(page, page.url, typeMask);
89 }; 89 };
90 90
91 port.on("filters.isWhitelisted", message => 91 port.on("filters.isWhitelisted", message =>
Manish Jethani 2017/09/21 08:02:37 Changed this to isWhitelisted since "Page" is kind
92 { 92 {
93 return !!checkWhitelisted(new ext.Page(message.tab)); 93 return !!checkWhitelisted(new ext.Page(message.tab));
94 }); 94 });
95 95
96 port.on("filters.whitelist", message => 96 port.on("filters.whitelist", message =>
97 { 97 {
98 let page = new ext.Page(message.tab); 98 let page = new ext.Page(message.tab);
99 let host = getDecodedHostname(page.url).replace(/^www\./, ""); 99 let host = getDecodedHostname(page.url).replace(/^www\./, "");
100 let filter = Filter.fromText("@@||" + host + "^$document"); 100 let filter = Filter.fromText("@@||" + host + "^$document");
101 if (filter.subscriptions.length && filter.disabled) 101 if (filter.subscriptions.length && filter.disabled)
(...skipping 123 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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld