Transparent JavaScript Blob Decompression

Modern browsers can handle deflated / gzip 'd data sent by the web server. For example, you can configure Apache to deliver gzip compressed XML files if the browser supports it.

I am trying to use this feature with Blob s.

I have a JavaScript program that creates a Blob from compressed data embedded in a JS file and then uses XMLHttpRequest to load the data from the generated URL blob:

.

However, no matter what content type I specify when creating the Blob, for example application/octet-stream;deflate

or application/octet-stream;gzip

, the browser does not use decompression. I've tried several content types but to no avail. The browser seems to be ignoring the encoding specified in the content type string.

Is it possible to load a resource blob:

and does it automatically unpack / inflate the browser in the same way as if it were loaded from http:

, i.e. a web server?

+3
javascript http blob


source to share


No one has answered this question yet

Check out similar questions:

7649
How does JavaScript blocking work?
7494
How can I remove a specific element from an array in JavaScript?
7432
How to check if a string contains a substring in JavaScript?
7287
What does "use strict" do in JavaScript, and what are the reasons for it?
5722
How can I remove a property from a JavaScript object?
5670
Which operator is equal (== vs ===) should be used in JavaScript comparisons?
5101
What's the most efficient way to deeply clone an object in JavaScript?
4829
How do I include a JavaScript file in another JavaScript file?
3714
How to check if an array contains a value in JavaScript?
2201
How do you decide when to use Node.js?



All Articles
Loading...
X
Show
Funny
Dev
Pics