enum Settings { "tabCloak" = "nebula||tabCloak", "abblob" = "nebula||abBlob" } type TabCloaks = "default" | "google" | "wikipedia" | "canvas" | "classroom" | "powerschool"; type AbCloaks = "a:b" | "blob" function cloakTab(cloak: TabCloaks | string) { const faviconElement = document.getElementById("favicon") as HTMLLinkElement; localStorage.setItem(Settings.tabCloak, cloak); switch(cloak) { case "google": document.title = "Google"; faviconElement.href = "/cloaks/google.png"; break; case "wikipedia": document.title = "Wikipedia"; faviconElement.href = "/cloaks/wikipedia.ico"; break; case "canvas": document.title = "Dashboard"; faviconElement.href = "/cloaks/canvas.ico"; break; case "classroom": document.title = "Home"; faviconElement.href = "/cloaks/classroom.png"; break; case "powerschool": document.title = "PowerSchool"; faviconElement.href = "/cloaks/ps.ico"; break; case "reset": //force a reset of favicon & title localStorage.setItem("nebula||tabCloak", "default"); window.location.reload(); default: return; } } function abCloak(type: AbCloaks | string) { localStorage.setItem(Settings.abblob, type); switch(type) { case "a:b": window.location.replace('https://google.com'); const win = window.open(); win!.document.body.style.margin = '0'; win!.document.body.style.height = '100vh'; const iframe = win!.document.createElement('iframe'); iframe.style.border = 'none'; iframe.style.width = '100%'; iframe.style.height = '100%'; iframe.style.margin = '0'; const url = window.location.href; iframe.src = url; win!.document.body.appendChild(iframe); break; case "blob": const htmlContent = ` `; window.location.replace("https://google.com"); const blob = new Blob([htmlContent], { type: 'text/html' }); const blobURL = URL.createObjectURL(blob); window.open(blobURL, '_blank'); break; default: return; } } export { cloakTab, abCloak, Settings }