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

Side by Side Diff: ext/background.js

Issue 29882555: Issue 6953 - Update frame structure for data URI frames (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Remove mistakenly uploaded dependencies file Created Sept. 25, 2018, 4:08 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 | « no previous file | 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 updatePageFrameStructure(details.frameId, details.tabId, details.url, 246 updatePageFrameStructure(details.frameId, details.tabId, details.url,
247 details.parentFrameId); 247 details.parentFrameId);
248 }, 248 },
249 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]}, 249 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]},
250 ["responseHeaders"]); 250 ["responseHeaders"]);
251 251
252 browser.webNavigation.onBeforeNavigate.addListener(details => 252 browser.webNavigation.onBeforeNavigate.addListener(details =>
253 { 253 {
254 // Requests can be made by about:blank frames before the frame's 254 // Requests can be made by about:blank frames before the frame's
255 // onCommitted event has fired, so we update the frame structure 255 // onCommitted event has fired; besides, the parent frame's ID is not
256 // for those now. 256 // available in onCommitted, nor is the onHeadersReceived event fired for
257 if (details.url.startsWith("about:")) 257 // about: and data: frames; so we update the frame structure for such
258 // frames here.
259 if (details.url.startsWith("about:") || details.url.startsWith("data:"))
258 { 260 {
259 updatePageFrameStructure(details.frameId, details.tabId, details.url, 261 updatePageFrameStructure(details.frameId, details.tabId, details.url,
260 details.parentFrameId); 262 details.parentFrameId);
261 } 263 }
262 }); 264 });
263 265
264 browser.webNavigation.onCommitted.addListener(details => 266 browser.webNavigation.onCommitted.addListener(details =>
265 { 267 {
266 // We have to update the frame structure for documents that weren't 268 // We have to update the frame structure for documents that weren't
267 // loaded over HTTP (including documents cached by Service Workers), 269 // loaded over HTTP (including documents cached by Service Workers),
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 return frames.get(0) || null; 603 return frames.get(0) || null;
602 } 604 }
603 }; 605 };
604 } 606 }
605 607
606 return ext.onMessage._dispatch( 608 return ext.onMessage._dispatch(
607 message, sender, sendResponse 609 message, sender, sendResponse
608 ).includes(true); 610 ).includes(true);
609 }); 611 });
610 } 612 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld