Created
October 14, 2024 21:30
-
-
Save adamschwartz/7b3a072af0de8bd580e1cb61770fc6fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
let root = document.documentElement | |
let timeout | |
let removeBanner = () => { | |
if (root.children[2]?.tagName === 'DIV') { | |
if (console && console.clear) console.clear() | |
return root.children[2].remove() | |
} | |
timeout = setTimeout(removeBanner) | |
} | |
const clearFavicon = () => { | |
let el = document.head.querySelector('link[rel="icon"]') | |
if (!el) { | |
el = document.createElement('link') | |
el.setAttribute('rel', 'icon') | |
el.setAttribute('type', 'image/x-icon') | |
document.head.appendChild(el) | |
} | |
el.href = 'data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=' | |
} | |
const runScripts = () => { | |
document.querySelectorAll('div.script').forEach(el => { | |
eval(el.textContent) | |
}) | |
} | |
const init = () => { | |
clearFavicon() | |
removeBanner() | |
runScripts() | |
} | |
init() | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment