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

Side by Side Diff: lib/whitelisting.js

Issue 29362203: Issue 4599 - Update the page structure more eagerly (Closed)
Patch Set: Created Nov. 10, 2016, 3:16 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 | « chrome/ext/background.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-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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (header.name.toLowerCase() == "x-adblock-key" && header.value) 178 if (header.name.toLowerCase() == "x-adblock-key" && header.value)
179 { 179 {
180 let url = new URL(details.url); 180 let url = new URL(details.url);
181 let key = checkKey(header.value, url); 181 let key = checkKey(header.value, url);
182 if (key) 182 if (key)
183 { 183 {
184 // For pre-rendered tabs we don't know for sure the navigation is going 184 // For pre-rendered tabs we don't know for sure the navigation is going
185 // to happen until the onCommitted event fires. Unfortunately if we want 185 // to happen until the onCommitted event fires. Unfortunately if we want
186 // sitekey whitelisting to work for requests made before onCommitted has 186 // sitekey whitelisting to work for requests made before onCommitted has
187 // been fired we must update the page structure now anyway. 187 // been fired we must update the page structure now anyway.
188 ext._updatePageFrameStructure(details.frameId, details.tabId, details.ur l, true); 188 ext._updatePageFrameStructure(details.frameId, details.tabId,
189 details.url, true);
189 recordKey(key, page, url); 190 recordKey(key, page, url);
190 break; 191 break;
191 } 192 }
192 } 193 }
193 } 194 }
194 } 195 }
195 196
196 if (typeof chrome == "object") 197 if (typeof chrome == "object")
197 chrome.webRequest.onHeadersReceived.addListener( 198 chrome.webRequest.onHeadersReceived.addListener(
198 onHeadersReceived, 199 onHeadersReceived,
199 { 200 {
200 urls: ["http://*/*", "https://*/*"], 201 urls: ["http://*/*", "https://*/*"],
201 types: ["main_frame", "sub_frame"] 202 types: ["main_frame", "sub_frame"]
202 }, 203 },
203 ["responseHeaders"] 204 ["responseHeaders"]
204 ); 205 );
OLDNEW
« no previous file with comments | « chrome/ext/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld