Skip to content

Commit

Permalink
fix(respondable): work on iframes in shadow DOM (#2857)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored and straker committed Apr 1, 2021
1 parent df5d01b commit 65cbfd0
Show file tree
Hide file tree
Showing 2 changed files with 589 additions and 550 deletions.
10 changes: 5 additions & 5 deletions lib/core/utils/respondable/assert-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function assertIsParentWindow(win) {
}

export function assertIsFrameWindow(win) {
assetNotGlobalWindow(win);
const frames = Array.from(window.frames);
if (!frames.some(frame => frame === win)) {
throw new Error('Respondable target must be a frame in the current window');
}
assetNotGlobalWindow(win);
assert(
win.parent === window,
'Respondable target must be a frame in the current window'
);
}

export function assetNotGlobalWindow(win) {
Expand Down
Loading

0 comments on commit 65cbfd0

Please sign in to comment.