From 69eaf8d58c10c950a8f2eaab683568960fc9b87b Mon Sep 17 00:00:00 2001 From: thonk <101288516+VillainsRule@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:30:25 -0500 Subject: [PATCH 1/2] Redo iframe opening --- static/assets/scripts/home.js | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/static/assets/scripts/home.js b/static/assets/scripts/home.js index 16438ad8b..20397f1ee 100644 --- a/static/assets/scripts/home.js +++ b/static/assets/scripts/home.js @@ -6,32 +6,17 @@ try { inFrame = true; }; -if (!inFrame && !navigator.userAgent.includes("Firefox")) { - const popup = open("about:blank", "_blank") - if (!popup || popup.closed) alert("Please allow popups and redirects.") - else { - const doc = popup.document - const iframe = doc.createElement("iframe") - const style = iframe.style - const link = doc.createElement("link") +if (!inFrame && !navigator.userAgent.includes('Firefox')) { + const popup = open('about:blank', '_blank') + if (!popup || popup.closed) return alert('Please allow popups and redirects.'); - const name = localStorage.getItem("name") || "My Drive - Google Drive"; - const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/assets/media/branding/product/1x/drive_2020q4_32dp.png"; - - doc.title = name; - link.rel = "icon"; - link.href = icon; - - iframe.src = location.href - style.position = "fixed" - style.top = style.bottom = style.left = style.right = 0 - style.border = style.outline = "none" - style.width = style.height = "100%" - - doc.head.appendChild(link); - doc.body.appendChild(iframe); - location.replace(localStorage.getItem('panicLink') || 'https://www.nasa.gov/'); - }; + popup.document.write(` + +