|
|
Maybe I don't quite get GM_xmlhttpRequest, I'm not getting any page or errors either.
|
|
|
I think I answered my own question...
... I think... |
|
|
This is probably a bit late but here's some code I use for checking my mail, it's runnable but it needs a proper url to do something useful as I've purged the personal data.
GM_xmlhttpRequest({
method: 'POST',
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Content-type': 'application/x-www-form-urlencoded'
},
url: 'https://webmail.hoard.com/imp/redirect.php',
data: 'load_frameset=1&autologin=0&mailbox=INBOX&imapuser=myusername&pass=mypassword',
onload:function(result) {
var title = result.responseText.match(/<title>\D*(\d+)\D*<\/title>/);
if (title) show(title[1])
}
});
</title>I think the default headers are the normal Firefox ones, and all the parameters are optional except
GM_xmlhttpRequest({
method: 'POST',
url: 'https://webmail.hoard.com/imp/redirect.php',
data: 'load_frameset=1&autologin=0&mailbox=INBOX&imapuser=myusername&pass=mypassword',
});
|
|
|
Not too late, actually that's what I tried, except documentation said 'Content-type' is required, maybe I did something else wrong...
I can see that headers shouldn't be required, so I can try that.
|
|
|
I've just tried it with my server and it seems to work fine, the only thing that look suspicious is the var page = window.location.href; as the url for the current page probably isn't where you want to POST to and even if it is POST should be upper case and as for 0.6.6 it has GM_xmlhttpRequest i would recommend adding onload:function(res){alert(res.responseText)}to see what (if anything) comes back |
|
|
POST and GET return different responses.
|