Hi,

I have a problem with the following code. It works on Chrome
+Tampermonkey but fails with Firefox+Greasemonkey.
This function is called 16 times with a different 'idp', it works 13
times, but 3 'idp' get stuck on readyState 1 and I don't understand
why.

What am I missing?

Thanks.


function repFetch (idp) {
  if (!GM_xmlhttpRequest) {
    alert('Please upgrade to the latest version of Greasemonkey.');
    return;
  }

  GM_xmlhttpRequest({
    method: "GET",
    url: 'http://' + window.location.hostname + '/reparer_a.php?id_a='
+ idp,
    onload: function(req) {
      if (req.status == 200) {
        try {
          var pricelist = req.responseText.match(/name='type_r'
value='\d+'/g).join().match(/\d+/g);
          var fiab = req.responseText.match(/name='fiabilite' value='\d
+.\d+'/).join().match(/\d+.\d+/);
        }
        catch(err) {
          GM_log([
            req.status,
            req.statusText,
            req.finalUrl
          ].join("\n"));
          GM_log(err.message + '\nCan\'t fetch data. Page structure
might have changed.');
          return 0;
        }
        rowRefresh(idp, fiab, pricelist);
      }
      else {
        GM_log([
          req.status,
          req.statusText,
          req.finalUrl
        ].join("\n"));
      }
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to