简体   繁体   English

在Firefox扩展中使用XMLHttpRequest获取二进制数据

[英]Get binary data with XMLHttpRequest in a Firefox extension

I'm trying to download some binary data from my Firefox extension. 我正在尝试从我的Firefox扩展中下载一些二进制数据。 When I try to set a created XMLHttpRequest to arraybuffer mode: 当我尝试将创建的XMLHttpRequest设置为arraybuffer模式时:

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? 有没有其他方法可以在Firefox扩展中下载二进制数据?

您必须先调用open方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM