[Greasemonkey] RE: GM_xmlhttpRequest: Anyway to tell what 'url'
resolved to?
Paul Bardo
greasemonkey at otherlies.com
Mon Jan 9 15:12:17 EST 2006
On 1/8/06, Paul Bardo <greasemonkey at otherlies.com> wrote:
> If I run a GM_xmlhttpRequest to example.com, but example.com redirects to
> www.example.com is there anyway to tell?
>
> If I try to go to www.example.com/example?a=100, and it redirects to
> www.othersite.com/archive.html#100 is there anyway to tell
> that (whole different domain)?
>
> The request still works, and the responseText is correct, but I can't find
> anyway of telling what the "real" url is. I've tries looking at the
> responseHeaders, but I didn't see anything there that would help.
>
I tried adding an 'onreadystatechange' callback, and just logging
everything return each time it gets called. Unfortunately, that
didn't seem to help. My thought was that I would see the request for
the original page, the 3xx response from the server, and then a second
request; but nothing like that happened. It looks the same as a
request for a page that has no redirection.
I think I'm at the end of the line with GM_xmlhttpRequest. Is there
any other way to get final resolved URL from a given URL? The only
way I can think of would be to load the page into a hidden frame or
something and just look at 'location' on that element.
Any better ideas?
More information about the Greasemonkey
mailing list