Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get binary data with XMLHttpRequest in a Firefox extension

I'm trying to download some binary data from my Firefox extension. When I try to set a created XMLHttpRequest to arraybuffer mode:

oHTTP = new XMLHttpRequest();   
oHTTP.responseType = "arraybuffer";

The error

InvalidStateErr
An attempt was made to use an object that is not, or is no longer, usable

is thrown.

Is there another way to download binary data in a Firefox extension?

like image 248
dmi_ Avatar asked Jan 15 '23 03:01

dmi_


1 Answers

You must call the open method first.

like image 111
paa Avatar answered Jan 31 '23 00:01

paa