开发者

Modify the value of network.http.accept-encoding using javascript

I'd like to modify the about:config value of network.http.accept-encoding from gzip, deflate to identity using javascript before I make a web reques开发者_开发技巧t.


You cannot change Accept-Encoding. Firefox, at least, will block this header from being set through ajax.

What you could do, however, is send your AJAX or web request through a servlet filter which changes the header of the request before continuing on.


Firefox won't let you change settings from JavaScript (at least not on a webpage).

But, depending on what you want to do, you might be able to try using HttpRequest (AJAX) and setting the Accept-Encoding header yourself. I don't know if it lets you override that header or not, and you would be limited to the same domain the page is from (or, with newer versions, domains that explicitly allow cross-domain requests).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜