Skip to content

Instantly share code, notes, and snippets.

@adamschwartz
Created October 14, 2024 21:30
Show Gist options
  • Save adamschwartz/7b3a072af0de8bd580e1cb61770fc6fa to your computer and use it in GitHub Desktop.
Save adamschwartz/7b3a072af0de8bd580e1cb61770fc6fa to your computer and use it in GitHub Desktop.
(() => {
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