Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Firefox 3 GM_xmlhttprequest redirect problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jacky  
View profile  
 More options Apr 28 2008, 9:59 am
From: Jacky <jacky...@gmail.com>
Date: Mon, 28 Apr 2008 06:59:49 -0700 (PDT)
Local: Mon, Apr 28 2008 9:59 am
Subject: Firefox 3 GM_xmlhttprequest redirect problem
Hi, I'm using GM 0.7.20080121.0.

In FF2.0.0.14, when a GM_xmlhttprequest fired and receive a 301/302
response, it seems that FF would try to resolve to a correct url.

But in FF3b5, when a GM_xmlhttprequest fired, it would receive 301/302
directly at the onload function.

For the time being, I have modified the script to something like:

GM_xmlhttprequest({
    method:"GET",
    url: url,
    onload: function(response){
        if(response.status == 302 || response.status == 303){ //moved
            var loc = /Location: ([^\n]*)
\n/.exec(response.responseHeaders)[1];
            GM_xmlhttprequest({method:"GET", url:loc,
onload:arguments.callee})
        }
    }

})

I just don't know whether it's the responsibility the script or
browser to resolve the redirection?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
esquifit  
View profile  
 More options May 4 2008, 7:16 am
From: esquifit <esqui...@googlemail.com>
Date: Sun, 4 May 2008 13:16:34 +0200
Local: Sun, May 4 2008 7:16 am
Subject: Re: [greasemonkey-users] Firefox 3 GM_xmlhttprequest redirect problem
Confirmed.  All scripts relying on automatic redirection are now
broken in Firefox 3, at least in GM 0.7.20080121.0.  I've already
found this in the "RSS Panel X" [1].

(Actually I find this extremely useful.  An obvious application is to
resolve shortened urls à la tinyurl without the need of an extra
request, besides the fact that probably not all among the several
similar services offer a preview feature [2] like Tinyurl which can be
used to find the destination url before actually loading the page).

In order to ensure backwards compatibility it would be better to have
an extra boolean attribute, say 'follow_redirects',  in the argument
to GM_xmlhttpRequest which would default to 'false'.  Is this
feasible?

[1] http://userscripts.org/scripts/show/6073
[2] http://tinyurl.com/preview.php


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
esquifit  
View profile  
 More options May 6 2008, 4:58 pm
From: esquifit <esqui...@googlemail.com>
Date: Tue, 6 May 2008 22:58:57 +0200
Local: Tues, May 6 2008 4:58 pm
Subject: Re: [greasemonkey-users] Firefox 3 GM_xmlhttprequest redirect problem
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »