diff --git a/src/SEQTA.ts b/src/SEQTA.ts index 02fb29fe..70773ca1 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -52,17 +52,29 @@ async function init() { replaceIcons(); - const observer = new MutationObserver(() => { - replaceIcons(); + const observer = new MutationObserver((mutations) => { + for (const mutation of mutations) { + + if ( + mutation.type === "attributes" && + mutation.target instanceof HTMLLinkElement && + mutation.target.rel.includes("icon") && + mutation.attributeName === "href" + ) { + replaceIcons(); + return; + } + } }); observer.observe(document.head, { - childList: true, subtree: true, attributes: true, - attributeFilter: ["href", "rel"], + attributeFilter: ["href"], }); + + try { await initializeSettingsState();