fix: use userID instead of username for great divide stats request

This commit is contained in:
Index 2024-06-28 01:31:21 -05:00
parent a71b0f26be
commit 27a8986272
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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
}