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

Unified Diff: lib/requestBlocker.js

Issue 29347167: Issue 4210 - Fix dynamic-frame collapsing in Chrome (Closed)
Patch Set: Created June 30, 2016, 1:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/requestBlocker.js
diff --git a/lib/requestBlocker.js b/lib/requestBlocker.js
index bb7e482e108dfb6d82778364b349a752a8cd4f99..2a3ad9dce95dcb6142254c546ff9900478e29b23 100644
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -79,16 +79,25 @@ ext.webRequest.onBeforeRequest.addListener((url, type, page, frame) =>
port.on("filters.collapse", (message, sender) =>
{
- if (checkWhitelisted(sender.page, sender.frame))
+ var sender_frame = sender.frame;
+ if (message.dynamicFrameURL)
+ {
+ sender_frame = {
+ url: new URL(message.dynamicFrameURL, message.baseURL),
+ parent: sender.frame
+ };
+ }
+
+ if (checkWhitelisted(sender.page, sender_frame))
return false;
let typeMask = RegExpFilter.typeMap[message.mediatype];
- let documentHost = extractHostFromFrame(sender.frame);
- let sitekey = getKey(sender.page, sender.frame);
+ let documentHost = extractHostFromFrame(sender_frame);
+ let sitekey = getKey(sender.page, sender_frame);
let blocked = false;
let specificOnly = checkWhitelisted(
- sender.page, sender.frame,
+ sender.page, sender_frame,
RegExpFilter.typeMap.GENERICBLOCK
);
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld