Imagine you are on a website called "www.yourWebsite.com", and you're using userscripts in Tampermonkey to get information from another website. In this case, you are using the GM_xmlhttpRequest function.
When you're using the GM_xmlhttpRequest function to go to "exampleWebsite.com", sometimes it redirects to "exampleWebsite.com/partOne", and sometimes it redirects to "exampleWebsite.com/partTwo".
Your goal is to find out whether it redirected to "exampleWebsite.com/partOne" or "exampleWebsite.com/partTwo". Now I've been trying to use window.location.href to find out where it redirected to, but all I've been getting is the website I'm on, which is "www.yourWebsite.com".
How I do fix this?
var GoToURL = "exampleWebsite.com";
GM_xmlhttpRequest({
method: "GET",
url: GoToURL,
onload: function(response) {
alert(window.location.href);
} //end of onload: function(response) {
}); //end of GM_xmlhttpRequest({