Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/platforms/web/runtime/modules/attrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ function baseSetAttr (el, key, value) {
// $flow-disable-line
el.__ieph = true /* IE placeholder patched */
}
el.setAttribute(key, value)
// When changing the attribute 'name' of an iframe element, the iframes window must be updated aswell. Otherwise
// anchor tags with a 'target' attribute won't hit the right iframe.
if (el.tagName === 'IFRAME' && key === 'name') {
setTimeout((el: HTMLIFrameElement) => {
el.contentWindow.name = value;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be wrong, but AFAICS this could trigger a browser security error, if the iFrame is cross-origin, e.g. like this:

Uncaught DOMException: Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame.

}, 0, el);
}
el.setAttribute(key, value);
}
}

Expand Down