This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
polyplus/js/profile/simplified-profile.js
2024-01-20 17:33:44 -06:00

20 lines
No EOL
617 B
JavaScript
Executable file

let Username = window.location.href.split('/')[4]
chrome.storage.sync.get(['PolyPlus_Settings'], function(result) {
Settings = result.PolyPlus_Settings;
if (Settings.SimplifiedProfileURLsOn === true) {
fetch("https://api.polytoria.com/v1/users/find?username=" + Username)
.then(response => response.json())
.then(data => {
window.location.href = "https://polytoria.com/users/" + data.id
})
.catch(error => {
console.log("An error occurred:", error);
});
}
if (!(parseInt(userID))) {
return
}
});