get rid of the boundIFrameLoad nightmare, makes Alu look MUCH more responsive.

This commit is contained in:
wearrrrr 2024-04-07 23:01:59 -05:00
parent 2bd41a9552
commit af050c52d3

View file

@ -115,8 +115,9 @@
iframe.style.pointerEvents = "auto"; iframe.style.pointerEvents = "auto";
iframe.classList.add("proxy-frame"); iframe.classList.add("proxy-frame");
document.body.appendChild(iframe); document.body.appendChild(iframe);
const boundIFrameLoad = iframeLoad.bind(null, iframe, loadingContent, topbar, closeButton); setTimeout(() => {
iframe.addEventListener("load", boundIFrameLoad); iframeLoad(iframe, loadingContent, topbar, closeButton);
}, 500);
function iframeLoad( function iframeLoad(
iframe: HTMLIFrameElement, iframe: HTMLIFrameElement,
@ -135,7 +136,6 @@
iframe.style.pointerEvents = "none"; iframe.style.pointerEvents = "none";
topbar.style.pointerEvents = "none"; topbar.style.pointerEvents = "none";
document.body.style.overflow = "auto"; document.body.style.overflow = "auto";
iframe.removeEventListener("load", boundIFrameLoad);
setTimeout(() => { setTimeout(() => {
iframe.src = "about:blank"; iframe.src = "about:blank";