From d908fcfdc40d155ea9c67ba54029c853002e40d3 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Thu, 1 Oct 2026 10:40:48 +0200 Subject: [PATCH] ui: removed https redirect --- src/ide/ui.ts | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/src/ide/ui.ts b/src/ide/ui.ts index 1c09dd96..44a298b0 100644 --- a/src/ide/ui.ts +++ b/src/ide/ui.ts @@ -2587,51 +2587,6 @@ async function loadAndStartPlatform() { } } -// HTTPS REDIRECT - -const useHTTPSCookieName = "__use_https"; - -function setHTTPSCookie(val: number) { - document.cookie = useHTTPSCookieName + "=" + val + ";domain=8bitworkshop.com;path=/;max-age=315360000"; -} - -function shouldRedirectHTTPS(): boolean { - // cookie set? either true or false - var shouldRedir = getCookie(useHTTPSCookieName); - if (typeof shouldRedir === 'string') { - return !!shouldRedir; // convert to bool - } - // set a 10yr cookie, value depends on if it's our first time here - var val = hasLocalStorage && !localStorage.getItem("__lastplatform") ? 1 : 0; - setHTTPSCookie(val); - return !!val; -} - -function _switchToHTTPS() { - bootbox.confirm('

Do you want to force the browser to use HTTPS from now on?

' + - '

WARNING: This will make all of your local files unavailable, so you should "Download All Changes" first for each platform where you have done work.

' + - '

You can go back to HTTP by setting the "' + useHTTPSCookieName + '" cookie to 0.

', (ok) => { - if (ok) { - setHTTPSCookie(1); - redirectToHTTPS(); - } - }); -} - -function redirectToHTTPS() { - if (window.location.protocol == 'http:' && isProductionHost()) { - if (shouldRedirectHTTPS()) { - uninstallErrorHandler(); - window.location.replace(window.location.href.replace(/^http:/, 'https:')); - } else { - $("#item_switch_https").click(_switchToHTTPS).show(); - } - } -} - -// redirect to HTTPS after script loads? -redirectToHTTPS(); - //// ELECTRON (and other external) STUFF export function setTestInput(path: string, data: FileData) { @@ -2679,6 +2634,8 @@ function writeOutputROMFile() { } } +// Start UI + function startUIWhenVisible() { let started = false; let observer = new IntersectionObserver((entries, observer) => {