Skip to content

Commit

Permalink
Apply suggestion for optional chainng
Browse files Browse the repository at this point in the history
  • Loading branch information
ling1726 committed Sep 13, 2024
1 parent c8f573e commit edd9d8a
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ function isSameOriginFrame(iframe) {
}

function getActiveElementDeep(containerInfo) {
let win = window;
if (containerInfo?.ownerDocument?.defaultView) {
win = containerInfo.ownerDocument.defaultView
}
let win = containerInfo?.ownerDocument?.defaultView ?? window;
let element = getActiveElement(win.document);
while (element instanceof win.HTMLIFrameElement) {
if (isSameOriginFrame(element)) {
Expand Down

0 comments on commit edd9d8a

Please sign in to comment.