Skip to content

Commit 5bf4e98

Browse files
committed
Fix login fetching for full_gpa
Somehow the login that was fetched in the page got a space added to it at the start of the string messing with the request afterwards. This commit should fix this even if they change it later and add more whitespace at the start or end of the string.
1 parent cfb0105 commit 5bf4e98

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fullgpa/gpa.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const grades = {
99

1010

1111
const login = document.querySelector("#profil > div.bloc.main > div > div.infos > div.item.login > span").innerText
12-
fetch(`https://${window.location.hostname}/user/${login}/notes?format=json`, {
12+
fetch(`https://${window.location.hostname}/user/${login.trim()}/notes?format=json`, {
1313
method: 'GET',
1414
credentials: 'include',
1515
}).then(response => response.json()).then(data => {
@@ -23,4 +23,4 @@ fetch(`https://${window.location.hostname}/user/${login}/notes?format=json`, {
2323
}
2424
}
2525
document.querySelector("#profil > div.bloc.top > div.rzone > span > span:nth-child(4)").innerText = divisor == 0 ? 0 : (total / divisor).toFixed(10);
26-
})
26+
})

fullgpa/gpa.zip

-51 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)