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

Unified Diff: ext/background.js

Issue 29832561: Issue 6774 - $document doesn't whitelist everything inside iframes in Edge (Closed)
Patch Set: Created July 17, 2018, 12:36 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
diff --git a/ext/background.js b/ext/background.js
index e0242e545396f8e48fdbbfea961b8cf42e14a8b9..60c7ce5ab97a60b69d0eb133fca8e714e7282ac9 100644
--- a/ext/background.js
+++ b/ext/background.js
@@ -559,10 +559,33 @@
if (!frames)
return null;
- let frame = frames.get(rawSender.frameId);
+ let frame;
+ // In Edge we don't have frameId
kzar 2018/07/17 14:46:07 Would be nice to add an Edge version number, so in
Sebastian Noack 2018/07/17 14:50:34 Also please spell out "Microsoft Edge".
geo 2018/07/17 16:36:21 Done.
geo 2018/07/17 16:36:22 Done.
+ // so we fall back to iterating over the tab's frames
+ // see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11716733
+ if (rawSender.frameId != undefined)
+ frame = frames.get(rawSender.frameId);
+ else
+ {
+ for (let [key, value] of frames)
+ {
+ let valueHref = value.url.href.replace("#", "");
Sebastian Noack 2018/07/17 14:20:42 This will only strip the # character itself but no
geo 2018/07/17 16:36:21 I'm sorry. I've fixed it. Yes, both value.url and
+
+ let rawSenderHref = rawSender.url ?
Sebastian Noack 2018/07/17 14:20:42 Under which circumstances is url undefined or null
geo 2018/07/17 16:36:21 I've based that off the comment at https://coderev
+ rawSender.url.replace("#", "") :
Sebastian Noack 2018/07/17 14:20:41 This will only strip the # character itself but no
geo 2018/07/17 16:36:21 Done.
+ "";
+
+ if (valueHref == rawSenderHref)
kzar 2018/07/17 14:46:07 I wonder what will happen if two frames have the s
Sebastian Noack 2018/07/17 14:50:34 Then we assume that it's the first of the two fram
kzar 2018/07/17 15:41:53 Fair enough, but maybe we should leave a comment h
geo 2018/07/17 16:36:22 Done.
+ {
+ frame = value;
+ this.id = key;
+ break;
+ }
+ }
+ }
+
if (frame)
return frame.parent || null;
-
return frames.get(0) || null;
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld