Closed pendave closed 7 years ago
[Redirects are handled transparently](https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#infrastructure-for-the-send()-method), but you can use the finalUrl property of GM_xmlhttpRequest to detect redirects.
var url = "http://google.com";
GM_xmlhttpRequest ( {
method: "GET",
url: url,
onload: function (response) {
console.debug ('Redirected: ' + (url != response.finalUrl));
}
} );
Yes it reports:
Redirected: true
How can I get the real redirected URL?
response.finalUrl
response.finalUrl is not the correct Location
How could GM_xmlhttpRequest fetch the 'Location' in the Response Headers?
It displays status:200 when I use GM_xmlhttpRequest, but actually it needs to be 302.