Picture yourself browsing a webpage called "www.yourWebsite.com" and utilizing userscripts in Tampermonkey to extract data from another site using the GM_xmlhttpRequest function.
As you make requests with the GM_xmlhttpRequest function to visit "exampleWebsite.com", you notice that it occasionally redirects to "exampleWebsite.com/partOne" or "exampleWebsite.com/partTwo".
Your objective is to determine whether the redirect leads to "exampleWebsite.com/partOne" or "exampleWebsite.com/partTwo". However, attempts to use window.location.href only return the current site, "www.yourWebsite.com".
How can this issue be addressed?
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({