From 96e463b4704dd7e1c79e41e73fb2c6352404516a Mon Sep 17 00:00:00 2001 From: wanhose Date: Wed, 10 Nov 2021 15:34:30 +0100 Subject: [PATCH] fix(scripts): content iframe detection --- scripts/content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/content.js b/scripts/content.js index f967766..10dc72c 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -59,7 +59,7 @@ const check = (node) => node instanceof HTMLElement && node.parentElement && !["BODY", "HTML"].includes(node.tagName) && - !["APP", "ROOT"].includes(node.id.toUpperCase()); + !(node.id && ["APP", "ROOT"].includes(node.id.toUpperCase())); /** * @description Cleans DOM @@ -83,7 +83,7 @@ const clean = () => { const fix = () => { const body = document.body; - const frame = window.frameElement; + const frame = !(window === window.parent || window.opener); const html = document.documentElement; if (body && html) {