Files
browserPGP/favicon.js
unknown ef3b7d5c0d a
2018-11-07 21:22:35 +00:00

25 lines
596 B
JavaScript

document.head = document.head || document.getElementsByTagName('head')[0];
function changeFavicon(src) {
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
while (true) {
changeFavicon('/favicon.ico');
await sleep(2000);
changeFavicon('/favicon2.ico');
await sleep(2000);
}