diff --git a/src/SEQTA.ts b/src/SEQTA.ts index 9d4dc8c7..70e05b5b 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -50,13 +50,30 @@ async function init() { documentLoadStyle.textContent = documentLoadCSS; document.head.appendChild(documentLoadStyle); - const icons = - document.querySelectorAll('link[rel*="icon"]'); + function replaceIcons() { + document + .querySelectorAll('link[rel*="icon"]') + .forEach((link) => { + if (link.href !== icon48) { + link.href = icon48; + } + }); + } - icons.forEach((link) => { - link.href = icon48; + replaceIcons(); + + const observer = new MutationObserver(() => { + replaceIcons(); }); + observer.observe(document.head, { + childList: true, + subtree: true, + attributes: true, + attributeFilter: ["href", "rel"], + }); + + try { await initializeSettingsState();