Created
October 5, 2022 19:03
-
-
Save kitze/743c37451569dd6daddc8e761567c0ec to your computer and use it in GitHub Desktop.
coda fix js
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
(function() { | |
'use strict'; | |
function onDocReady(fn) { | |
// see if DOM is already available | |
if (document.readyState === "complete" || document.readyState === "interactive") { | |
// call on next available tick | |
setTimeout(fn, 3000); | |
} else { | |
document.addEventListener("DOMContentLoaded", fn); | |
} | |
} | |
const changeFavicon = () => { | |
var link = document.querySelector("link[rel~='icon']"); | |
const head = document.getElementsByTagName('head')[0]; | |
if (!link) { | |
link = document.createElement('link'); | |
} | |
const icon = document.querySelector("[data-scroll-id=\"canvasScrollContainer\"] .UeEE5Inb"); | |
if (icon) { | |
link.href = icon.src; | |
link.rel = 'icon'; | |
head.appendChild(link); | |
} | |
} | |
onDocReady(changeFavicon); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment