Skip to content

Instantly share code, notes, and snippets.

@kitze
Created October 5, 2022 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitze/743c37451569dd6daddc8e761567c0ec to your computer and use it in GitHub Desktop.
Save kitze/743c37451569dd6daddc8e761567c0ec to your computer and use it in GitHub Desktop.
coda fix js
(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