Skip to content

Commit

Permalink
Merge pull request #63 from lpellegr/fix/iframe-removal-monitoring-sh…
Browse files Browse the repository at this point in the history
…adow-dom

Consider the right context when checking if iframe is removed
  • Loading branch information
Aaronius committed Oct 16, 2020
2 parents da8df79 + 0a492ab commit b613a29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parent/monitorIframeRemoval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const CHECK_IFRAME_IN_DOC_INTERVAL = 60000;
export default (iframe: HTMLIFrameElement, destructor: Destructor) => {
const { destroy, onDestroy } = destructor;
const checkIframeInDocIntervalId = setInterval(() => {
if (!document.contains(iframe)) {
if (!iframe.isConnected) {
clearInterval(checkIframeInDocIntervalId);
destroy();
}
Expand Down

0 comments on commit b613a29

Please sign in to comment.