From 651c41b32a378a692fe240e79a78e9bbb666da65 Mon Sep 17 00:00:00 2001 From: bat Date: Mon, 13 Mar 2023 12:28:00 +0000 Subject: [PATCH] Actualizar 'components/page.js' --- components/page.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/page.js b/components/page.js index e3c141a..cc6d0f6 100644 --- a/components/page.js +++ b/components/page.js @@ -66,6 +66,8 @@ export class Page extends HTMLElement { } initFrame() { + const wrap = document.createElement('div') + this.shadowRoot.appendChild(wrap) const tmp = document.createElement('iframe') tmp.sandbox = "allow-same-origin allow-scripts" const url = new URL( @@ -77,10 +79,10 @@ export class Page extends HTMLElement { ) url.searchParams.set('html', frameHtml) tmp.src = url.href - this.shadowRoot.insertAdjacentHTML( + wrap.insertAdjacentHTML( 'beforeend', tmp.outerHTML ) - const frames = this.shadowRoot.getElementsByTagName('iframe') + const frames = wrap.getElementsByTagName('iframe') this.frame = frames[frames.length - 1] this.textArea.addEventListener('blur', e => { const msg = ['srcdoc', e.target.value]