Hi, I am working on making my scripts compatible with Firefox 4, and I notice one script having a weird issue with GM_xmlhttpRequest. Below is the code in question.
The script still works perfectly fine in Firefox 3.6.15. I am not getting an exception or a parse error in FF 4. Alerts before and after (not in) the Request show up as expected, but nothing ever happens in any of the 'on' events. I tried removing its code and putting in just a basic alert, and it never shows up either. I then check my server logs, and the data IS being transmitted to the server. So somewhere along the way the GM is dying behind the scenes on the Request. What makes it even more weird for me is I have another script that is almost very similar, the same with the server code, and it works perfectly fine in Firefox 4 as far as I can tell. So does anyone have any ideas on what is wrong with this one? Is it my code or is it GM? My version of GM is 0.9.1. FF says 4.0 and is up to date. --------------------------------------- http://rveach.romhack.org/BvS/bvs_party_house_logger2.user.js GM_xmlhttpRequest({ method: 'POST', url: 'http://rveach.romhack.org/BvS/partylogger.php', headers: {'Content-type' : 'application/x-www-form-urlencoded'}, data: encodeURI(query), onerror: function(response) { alert("Party House Logger Failed!"); }, onload: function(response) { try { var text = response.responseText; if (text.startsWith("Saved;")) { //saved GM_setValue(saveName, saveText); if (showDialogResponse) { var divContent = document.createElement("div"); divContent.id = "bvsPartyLogger"; divContent.innerHTML = "<h1>Party House Logger</h1>Saved"; document.body.appendChild(divContent); } } else if (text.startsWith("Exists;")) { GM_setValue(saveName, saveText); if (showDialogResponse) { var divContent = document.createElement("div"); divContent.id = "bvsPartyLogger"; divContent.innerHTML = "<h1>Party House Logger</h1>Already Saved"; document.body.appendChild(divContent); } } else if ((text == null) || (text.length == 0)) { alert("Party House Logger Error:\n\nUnknown Error"); } else if (text.length >= 200) { alert("Party House Logger Error:\n\nError Message too big to display!"); } else { alert("Party House Logger Error:\n\n" + text); } } catch(e) { alert("Exception!\n\nError name: " + e.name + "\nError message: " + e.message); } } }); -- 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.
