From 0b5f08336619c27a20b95ef00452438491fe13eb Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 25 Apr 2024 20:12:16 +0100 Subject: [PATCH] don't load again if only page params changed --- scoresaber-utils.user.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scoresaber-utils.user.js b/scoresaber-utils.user.js index b3d183b..288b52d 100644 --- a/scoresaber-utils.user.js +++ b/scoresaber-utils.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name ScoreSaber Utils // @namespace https://ssu.fascinated.cc -// @version 1.0.4 +// @version 1.0.5 // @description Useful additions to ScoreSaber! // @author Fascinated // @match https://scoresaber.com/* @@ -112,10 +112,11 @@ async function loadPlayerData(path) { // Watch for URL changes let previousUrl = ""; const observer = new MutationObserver(function (mutations) { - if (location.href !== previousUrl) { - previousUrl = location.href; + const currentUrl = location.pathname; // Get the current URL without parameters + if (currentUrl !== previousUrl) { + previousUrl = currentUrl; - loadPlayerData(location.pathname); + loadPlayerData(currentUrl); } }); const config = { subtree: true, childList: true };