GM_xmlhttpRequest progress event?

53 views
Skip to first unread message

Yansky

unread,
Feb 21, 2010, 12:45:24 AM2/21/10
to greasemonkey-users
Does GM_xmlhttpRequest have access to the progress event when using
the binary method to upload files?

cc

unread,
Feb 21, 2010, 2:04:15 AM2/21/10
to greasemon...@googlegroups.com
Well, does it? Try it and see, and let us know. (Note: I've not yet had
reason to use GM_xhr, so I have no idea one way or another.)

On 2010-02-20 21:45, Yansky wrote:
> Does GM_xmlhttpRequest have access to the progress event when using
> the binary method to upload files?

--
cc | pseudonymous |<http://carlclark.mp/>


--
‖ Confidence is the feeling you have before you really understand the
problem. ‖ http://tagzilla.mozdev.org v0.066

Yansky

unread,
Feb 21, 2010, 1:12:30 PM2/21/10
to greasemonkey-users
I don't think it does, but I wanted to check here first before I
opened a ticket. I tried it like this but it didn't seem to work:
GM_xmlhttpRequest({
method: 'POST',
url: obj.url,
binary: true,
headers: {
"Content-Type": 'multipart/form-data; boundary=' + boundary,
"Content-Length": data.length
},
data: data,
onload: obj.callback,
progress: function(e){console.log(e);}
});

The syntax seems to be a bit unusual ( https://developer.mozilla.org/en/XMLHttpRequest#status
) as there's an "upload" attribute to the xmlhttprequest. e.g.
xhr.upload.addEventListener("progress", function(e) {....

Anthony Lieuallen

unread,
Feb 21, 2010, 5:56:40 PM2/21/10
to greasemon...@googlegroups.com
On 2/21/2010 12:45 AM, Yansky wrote:
> Does GM_xmlhttpRequest have access to the progress event when using
> the binary method to upload files?

http://wiki.greasespot.net/GM_xmlhttpRequest

No.

Reply all
Reply to author
Forward
0 new messages