zip.js loads inflate.js several times

211 Views Asked by At

I use zip.js to unzip file in browser. But it loads inflate.js many times from client. Each load is successfull (200/304) but why does this happen so many times? How can I load inflate.js once on web page load? This is my usage code:

zip.workerScriptsPath = 'lib/';
var br = new zip.Data64URIReader(blob);
zip.createReader(br, function (reader) {
  /// ...
}

firebug info

1

There are 1 best solutions below

0
On BEST ANSWER
zip.useWebWorkers = false; 

and including

<script type="application/javascript" src="lib/inflate.js"></script>

statically fixes the problem