From 27a89862724a0958d638ef99b14ca90c18dad4aa Mon Sep 17 00:00:00 2001 From: Index Date: Fri, 28 Jun 2024 01:31:21 -0500 Subject: [PATCH] fix: use userID instead of username for great divide stats request --- js/background.js | 2 +- the-great-divide.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 1d2e669..5f549b1 100755 --- a/js/background.js +++ b/js/background.js @@ -105,7 +105,7 @@ chrome.runtime.onMessage.addListener(async function (request, sender, sendRespon if (request.action === 'reload') { chrome.runtime.reload(); } else if (request.action === 'greatdivide_stats') { - const Statistics = (await (await fetch('https://stats.silly.mom/player_stats?username=' + request.username)).json()).results + const Statistics = (await (await fetch('https://stats.silly.mom/player_stats?id=' + request.userID)).json()).results chrome.tabs.query({ active: true, currentWindow: true }, function(tabs){ chrome.scripting diff --git a/the-great-divide.js b/the-great-divide.js index c83e149..31e4efb 100644 --- a/the-great-divide.js +++ b/the-great-divide.js @@ -119,7 +119,7 @@ async function UserStatsTab() { if (Fetched === false) { chrome.runtime.sendMessage({ action: "greatdivide_stats", - username: window.location.pathname.split('/')[2] + userID: document.querySelector('.dropdown-item.text-danger[href^="/report"]').getAttribute('href').split('?')[0].split('/')[3] }); Fetched = true }