diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js index 69b7d3c..75c013e 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js @@ -136,7 +136,13 @@ introSkipper.injectCss = function () { * Calling this function is a no-op if the CSS has already been injected. */ introSkipper.injectButton = async function () { - if (introSkipper.testElement(".btnSkipIntro")) { + // Ensure the button we're about to inject into the page doesn't conflict with a pre-existing one + const preExistingButton = introSkipper.testElement("div.skipIntro"); + if (preExistingButton) { + preExistingButton.style.display = "none"; + } + + if (introSkipper.testElement(".btnSkipIntro.injected")) { introSkipper.d("Button already added"); return; } @@ -155,7 +161,7 @@ introSkipper.injectButton = async function () { button.classList.add("hide"); button.addEventListener("click", introSkipper.doSkip); button.innerHTML = ` -