Commit b09f7d51 authored by Maria Kazinova's avatar Maria Kazinova Committed by Commit Bot

Added a better check for cross-origin iframes form parsing on iOS.

Iframes with empty "src" property can be cross-origin iframes, which
causes DOMException on some websites when the parsing is done.
Added a check for accessing frame's window.location.href parameter
which is a more trustworthy indicator.

Bug: 850388
Change-Id: Id644df4f3790e5ea5e3659964ccd96b378cd70d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066904
Commit-Queue: Maria Kazinova <kazinova@google.com>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745000}
parent 4d0f77f6
......@@ -69,9 +69,12 @@ const getSameOriginFrames = function(win) {
const frames = win.document.getElementsByTagName('iframe');
const result = [];
for (let i = 0; i < frames.length; i++) {
if (!frames[i].src ||
__gCrWeb.common.isSameOrigin(win.location.href, frames[i].src)) {
result.push(frames[i].contentWindow);
try {
if (__gCrWeb.common.isSameOrigin(
win.location.href, frames[i].contentWindow.location.href)) {
result.push(frames[i].contentWindow);
}
} catch (e) {
}
}
return result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment