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

Side by Side Diff: lib/requestBlocker.js

Issue 29750566: Issue 6565 - Ensure the URL is known for requests we might block (Closed)
Patch Set: Created April 12, 2018, 11:51 a.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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // path (unlike "originUrl" on Firefox), but is still good enough 144 // path (unlike "originUrl" on Firefox), but is still good enough
145 // (in case the tab/frame is unknown) for the $domain filter option 145 // (in case the tab/frame is unknown) for the $domain filter option
146 // and most document exception rules which only match the domain part. 146 // and most document exception rules which only match the domain part.
147 else if (details.initiator) 147 else if (details.initiator)
148 originUrl = new URL(details.initiator); 148 originUrl = new URL(details.initiator);
149 149
150 let page = null; 150 let page = null;
151 let frame = null; 151 let frame = null;
152 if (details.tabId != -1) 152 if (details.tabId != -1)
153 { 153 {
154 page = new ext.Page({id: details.tabId}); 154 page = new ext.Page({id: details.tabId, url: details.url});
Sebastian Noack 2018/04/12 13:27:09 Shouldn't this be rather the originUrl than the ur
Sebastian Noack 2018/04/12 13:38:09 However, if no originUrl is given these request sh
kzar 2018/04/13 15:36:37 Yea, unfortunately I can.
kzar 2018/04/13 15:36:37 Yea, good point. Well since we now know why you co
Sebastian Noack 2018/04/14 03:21:26 How do I get that new tab page?
155 frame = ext.getFrame( 155 frame = ext.getFrame(
156 details.tabId, 156 details.tabId,
157 // We are looking for the frame that contains the element which 157 // We are looking for the frame that contains the element which
158 // has triggered this request. For most requests (e.g. images) we 158 // has triggered this request. For most requests (e.g. images) we
159 // can just use the request's frame ID, but for subdocument requests 159 // can just use the request's frame ID, but for subdocument requests
160 // (e.g. iframes) we must instead use the request's parent frame ID. 160 // (e.g. iframes) we must instead use the request's parent frame ID.
161 details.type == "sub_frame" ? details.parentFrameId : details.frameId 161 details.type == "sub_frame" ? details.parentFrameId : details.frameId
162 ); 162 );
163 } 163 }
164 164
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 port.on("request.blockedByRTCWrapper", (msg, sender) => 266 port.on("request.blockedByRTCWrapper", (msg, sender) =>
267 { 267 {
268 return ext.webRequest.onBeforeRequest._dispatch( 268 return ext.webRequest.onBeforeRequest._dispatch(
269 new URL(msg.url), 269 new URL(msg.url),
270 "webrtc", 270 "webrtc",
271 sender.page, 271 sender.page,
272 sender.frame 272 sender.frame
273 ).includes(false); 273 ).includes(false);
274 }); 274 });
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