fix(scripts): content iframe detection
This commit is contained in:
parent
7a45974e98
commit
96e463b470
@ -59,7 +59,7 @@ const check = (node) =>
|
|||||||
node instanceof HTMLElement &&
|
node instanceof HTMLElement &&
|
||||||
node.parentElement &&
|
node.parentElement &&
|
||||||
!["BODY", "HTML"].includes(node.tagName) &&
|
!["BODY", "HTML"].includes(node.tagName) &&
|
||||||
!["APP", "ROOT"].includes(node.id.toUpperCase());
|
!(node.id && ["APP", "ROOT"].includes(node.id.toUpperCase()));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Cleans DOM
|
* @description Cleans DOM
|
||||||
@ -83,7 +83,7 @@ const clean = () => {
|
|||||||
|
|
||||||
const fix = () => {
|
const fix = () => {
|
||||||
const body = document.body;
|
const body = document.body;
|
||||||
const frame = window.frameElement;
|
const frame = !(window === window.parent || window.opener);
|
||||||
const html = document.documentElement;
|
const html = document.documentElement;
|
||||||
|
|
||||||
if (body && html) {
|
if (body && html) {
|
||||||
|
Loading…
Reference in New Issue
Block a user