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

Delta Between Two Patch Sets: lib/whitelisting.js

Issue 29357576: Issue 4483 - Update page structure when sitekey is received (Closed)
Left Patch Set: Created Oct. 17, 2016, 10:16 a.m.
Right Patch Set: Create page on one line Created Oct. 19, 2016, 12:36 p.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 | « chrome/ext/background.js ('k') | no next file » | no next file with change/comment »
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-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); 188 ext._updatePageFrameStructure(details.frameId, details.tabId, details.ur l, true);
189 recordKey(key, page, url); 189 recordKey(key, page, url);
190 break; 190 break;
191 } 191 }
192 } 192 }
193 } 193 }
194 } 194 }
195 195
196 if (typeof chrome == "object") 196 if (typeof chrome == "object")
197 chrome.webRequest.onHeadersReceived.addListener( 197 chrome.webRequest.onHeadersReceived.addListener(
198 onHeadersReceived, 198 onHeadersReceived,
199 { 199 {
200 urls: ["http://*/*", "https://*/*"], 200 urls: ["http://*/*", "https://*/*"],
201 types: ["main_frame", "sub_frame"] 201 types: ["main_frame", "sub_frame"]
202 }, 202 },
203 ["responseHeaders"] 203 ["responseHeaders"]
204 ); 204 );
LEFTRIGHT

Powered by Google App Engine
This is Rietveld