diff --git a/scoresaber-utils.user.js b/scoresaber-utils.user.js index 288b52d..ca01e50 100644 --- a/scoresaber-utils.user.js +++ b/scoresaber-utils.user.js @@ -7,8 +7,8 @@ // @match https://scoresaber.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=scoresaber.com // @license MIT -// @updateURL https://git.fascinated.cc/Fascinated/ScoreSaberUtils-Backend/raw/branch/master/scoresaber-utils.user.js -// @downloadURL https://git.fascinated.cc/Fascinated/ScoreSaberUtils-Backend/raw/branch/master/scoresaber-utils.user.js +// @updateURL https://git.fascinated.cc/Fascinated/ScoreSaberUtils-Script/raw/branch/master/scoresaber-utils.user.js +// @downloadURL https://git.fascinated.cc/Fascinated/ScoreSaberUtils-Script/raw/branch/master/scoresaber-utils.user.js // @run-at document-end // ==/UserScript== @@ -111,13 +111,15 @@ async function loadPlayerData(path) { // Watch for URL changes let previousUrl = ""; -const observer = new MutationObserver(function (mutations) { +const observer = new MutationObserver(() => { const currentUrl = location.pathname; // Get the current URL without parameters - if (currentUrl !== previousUrl) { - previousUrl = currentUrl; - - loadPlayerData(currentUrl); + if (currentUrl == previousUrl) { + return; } + + console.log("Switching Page:", currentUrl); + previousUrl = currentUrl; + loadPlayerData(currentUrl); }); const config = { subtree: true, childList: true }; observer.observe(document, config);