", {
33 | "class" : "alert alert-danger",
34 | text : "Error reading " + f.name + ": " + e.message
35 | }));
36 | });
37 | }
38 |
39 | var files = evt.target.files;
40 | for (var i = 0; i < files.length; i++) {
41 | handleFile(files[i]);
42 | }
43 | });
44 |
45 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/documentation/faq.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Frequently Asked Questions"
3 | layout: default
4 | section: main
5 | ---
6 |
7 | ### "Corrupted zip or bug: unexpected signature"
8 |
9 | If you are sure that the zip file is correct, that error often comes from a
10 | corrupted content. An ajax request, if not prepared correctly, will try to
11 | decode the binary content as a text and corrupt it. See
12 | [this page]({{site.baseurl}}/documentation/howto/read_zip.html).
13 |
14 | ### My browser crashes / becomes unresponsive / never finish the execution
15 |
16 | That happens if you try to handle to much data with the synchronous API. If
17 | possible, try the asynchronous API, see
18 | [this page]({{site.baseurl}}/documentation/limitations.html) for more informations.
19 |
20 | ### Can't read the data of [...]. Is it in a supported JavaScript type ?
21 |
22 | Or the old message:
23 |
24 | > The data of [...] is in an unsupported format
25 |
26 | The method [`file(name, data [,options])`]({{site.baseurl}}/documentation/api_jszip/file_data.html)
27 | accepts string and binary inputs for `data`.
28 |
29 | If you use an unsupported type, an object for example, you will get this error:
30 |
31 | ```js
32 | // WRONG
33 | var data = {
34 | content: new ArrayBuffer(...)
35 | };
36 | zip.file("my.data", data); // won't work, data is an object
37 |
38 | // CORRECT
39 | var data = new ArrayBuffer(...);
40 | zip.file("my.data", data); // will work, JSZip accepts ArrayBuffer
41 | ```
42 |
43 | ### My mac generates a `.cpgz` file when I try to extract the zip file
44 |
45 | MacOS Finder has a lot of bug related to zip files (the `unzip` command line
46 | tool is fine). When something goes wrong, Finder will generate this cpgz file
47 | instead of showing an error.
48 |
49 | To get a correct result, try to enable compression in `generateAsync`:
50 |
51 | ```js
52 | zip.generateAsync({
53 | type:"...",
54 | compression: "DEFLATE" // <-- here
55 | });
56 | ```
57 |
58 | Using `platform: "UNIX"` may help too.
59 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/documentation/howto/read_zip.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "How to read a file"
3 | layout: default
4 | section: example
5 | ---
6 |
7 | This page explains how to read an existing zip file or add a existing file into
8 | the zip file.
9 |
10 |
11 | ### In the browser
12 |
13 | #### AJAX request
14 |
15 | Getting binary data with an ajax request is hard (mainly because of IE <= 9).
16 | The easy way is to use [JSZipUtils.getBinaryContent](https://github.com/stuk/jszip-utils).
17 | With JSZipUtils.getBinaryContent, you can do the following (see the
18 | documentation for more examples) :
19 |
20 | ```js
21 | JSZipUtils.getBinaryContent('path/to/content.zip', function(err, data) {
22 | if(err) {
23 | throw err; // or handle err
24 | }
25 |
26 | JSZip.loadAsync(data).then(function () {
27 | // ...
28 | });
29 | });
30 |
31 | // or, with promises:
32 |
33 | new JSZip.external.Promise(function (resolve, reject) {
34 | JSZipUtils.getBinaryContent('path/to/content.zip', function(err, data) {
35 | if (err) {
36 | reject(err);
37 | } else {
38 | resolve(data);
39 | }
40 | });
41 | }).then(function (data) {
42 | return JSZip.loadAsync(data);
43 | })
44 | .then(...)
45 | ```
46 |
47 |
48 |
49 | If you need to adapt an existing solution to what getBinaryContent does, here
50 | are the details. When doing a XHR request (level 1, without setting the
51 | `responseType`) the browser will try to interpret the response as a string and
52 | decode it from its charset. To avoid this on Firefox/Chrome/Opera, you need to
53 | set mime type : `xhr.overrideMimeType("text/plain; charset=x-user-defined");`.
54 | On IE <= 9, this is harder. The overrideMimeType trick doesn't work so we need
55 | to use [vbscript](http://stackoverflow.com/questions/1095102/how-do-i-load-binary-image-data-using-javascript-and-xmlhttprequest)
56 | and non standard attributes.
57 | On IE > 9, overrideMimeType doesn't work but xhr2 does.
58 |
59 | With [xhr 2](http://caniuse.com/xhr2), you can just set the responseType
60 | attribute : `xhr.responseType = "arraybuffer";`. With this, the browser will
61 | return an ArrayBuffer.
62 |
63 | #### Local files
64 |
65 | If the browser supports the [FileReader API](http://caniuse.com/filereader),
66 | you can use it to read a zip file. JSZip can read ArrayBuffer, so you can use
67 | `FileReader.readAsArrayBuffer(Blob)`, see this [example]({{site.baseurl}}/documentation/examples/read-local-file-api.html).
68 |
69 | ### In nodejs
70 |
71 | JSZip can read Buffers so you can do the following :
72 |
73 | #### Local file
74 |
75 | ```js
76 | "use strict";
77 |
78 | var fs = require("fs");
79 | var JSZip = require("jszip");
80 |
81 | // read a zip file
82 | fs.readFile("test.zip", function(err, data) {
83 | if (err) throw err;
84 | JSZip.loadAsync(data).then(function (zip) {
85 | // ...
86 | });
87 | });
88 | // or
89 | new JSZip.external.Promise(function (resolve, reject) {
90 | fs.readFile("test.zip", function(err, data) {
91 | if (err) {
92 | reject(e);
93 | } else {
94 | resolve(data);
95 | }
96 | });
97 | }).then(function (data) {
98 | return JSZip.loadAsync(data);
99 | })
100 | .then(...)
101 |
102 |
103 | // read a file and add it to a zip
104 | fs.readFile("picture.png", function(err, data) {
105 | if (err) throw err;
106 | var zip = new JSZip();
107 | zip.file("picture.png", data);
108 | });
109 | // or
110 | var contentPromise = new JSZip.external.Promise(function (resolve, reject) {
111 | fs.readFile("picture.png", function(err, data) {
112 | if (err) {
113 | reject(e);
114 | } else {
115 | resolve(data);
116 | }
117 | });
118 | });
119 | zip.file("picture.png", contentPromise);
120 |
121 |
122 | // read a file as a stream and add it to a zip
123 | var stream = fs.createReadStream("picture.png");
124 | zip.file("picture.png", stream);
125 | ```
126 |
127 | #### Remote file
128 |
129 | There are a lot of nodejs libraries doing http requests, from the built-in
130 | [http](http://nodejs.org/docs/latest/api/http.html) to the
131 | [npm packages](https://www.npmjs.org/browse/keyword/http). Here are two
132 | examples, one with the default http API, the other with
133 | [request](https://github.com/mikeal/request) (but you're free to use your
134 | favorite library !). If possible, download the file as a Buffer (you will get
135 | better performances). If it's not possible, you can fallback to a binary string
136 | (the option is likely to be `encoding : "binary"`).
137 |
138 | ##### With http :
139 |
140 | ```js
141 | "use strict";
142 |
143 | var http = require("http");
144 | var url = require("url");
145 | var JSZip = require("jszip");
146 |
147 | var req = http.get(url.parse("http://localhost/.../file.zip"), function (res) {
148 | if (res.statusCode !== 200) {
149 | console.log(res.statusCode);
150 | // handle error
151 | return;
152 | }
153 | var data = [], dataLen = 0;
154 |
155 | // don't set the encoding, it will break everything !
156 | // or, if you must, set it to null. In that case the chunk will be a string.
157 |
158 | res.on("data", function (chunk) {
159 | data.push(chunk);
160 | dataLen += chunk.length;
161 | });
162 |
163 | res.on("end", function () {
164 | var buf = Buffer.concat(data);
165 |
166 | // here we go !
167 | JSZip.loadAsync(buf).then(function (zip) {
168 | return zip.file("content.txt").async("string");
169 | }).then(function (text) {
170 | console.log(text);
171 | });
172 | });
173 | });
174 |
175 | req.on("error", function(err){
176 | // handle error
177 | });
178 | ```
179 |
180 | ##### With request :
181 |
182 | ```js
183 | "use strict";
184 |
185 | var request = require('request');
186 | var JSZip = require("jszip");
187 |
188 | request({
189 | method : "GET",
190 | url : "http://localhost/.../file.zip",
191 | encoding: null // <- this one is important !
192 | }, function (error, response, body) {
193 | if(error || response.statusCode !== 200) {
194 | // handle error
195 | return;
196 | }
197 | JSZip.loadAsync(body).then(function (zip) {
198 | return zip.file("content.txt").async("string");
199 | }).then(function () {
200 | console.log(text);
201 | });
202 | });
203 | ```
204 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/documentation/howto/write_zip.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "How to write a file / give it to the user"
3 | layout: default
4 | section: example
5 | ---
6 |
7 | ### In the browser
8 |
9 | With only javascript, this part won't work in old browsers, including IE < 10.
10 | For those browsers, you can use a flash polyfill, see below.
11 |
12 | You can also see this
13 | [example]({{site.baseurl}}/documentation/examples/download-zip-file.html).
14 |
15 | #### Blob URL / FileSaver
16 |
17 | With recent browsers, the easiest way is to use `saveAs` or a polyfill, see
18 | [FileSaver.js](https://github.com/eligrey/FileSaver.js) :
19 |
20 | ```js
21 | zip.generateAsync({type:"blob"})
22 | .then(function (blob) {
23 | saveAs(blob, "hello.zip");
24 | });
25 | ```
26 |
27 | Under the hood, the polyfill uses the native `saveAs` from the
28 | [FileSaver](http://www.w3.org/TR/file-writer-api/#the-filesaver-interface) API
29 | (on Chrome and IE10+) or use a [Blob URL](http://updates.html5rocks.com/2011/08/Downloading-resources-in-HTML5-a-download)
30 | (on Firefox).
31 |
32 |
33 | #### Data URI
34 |
35 | For older browsers that support [data URI](http://caniuse.com/datauri), you can also
36 | do the following :
37 |
38 | ```js
39 | zip.generateAsync({type:"base64"}).then(function (base64) {
40 | location.href="data:application/zip;base64," + base64;
41 | });
42 | ```
43 |
44 | The biggest issue here is that the filenames are very awkward, Firefox
45 | generates filenames such as `a5sZQRsx.zip.part` (see bugs
46 | [367231](https://bugzilla.mozilla.org/show_bug.cgi?id=367231) and
47 | [532230](https://bugzilla.mozilla.org/show_bug.cgi?id=532230), and Safari
48 | isn't much better with just `Unknown`.
49 |
50 | Browser support and resulting filename :
51 |
52 | Opera | Firefox | Safari | Chrome | Internet Explorer
53 | -------|---------|--------|--------|------------------
54 | "default.zip" | random alphanumeric with ".part" extension | "Unknown" (no extension) | "download.zip" on OSX and Linux, just "download" on Windows | No
55 |
56 | #### Downloadify
57 |
58 | [Downloadify](https://github.com/dcneiner/downloadify) uses a small Flash SWF
59 | to download files to a user's computer with a filename that you can choose.
60 | Doug Neiner has added the `dataType` option to allow you to pass a zip for
61 | downloading. Follow the [Downloadify demo](http://pixelgraphics.us/downloadify/test.html)
62 | with the following changes:
63 |
64 | ```js
65 | zip = new JSZip();
66 | zip.file("Hello.", "hello.txt");
67 |
68 | zip.generateAsync({type:"base64"}).then(function (base64) {
69 | Downloadify.create('downloadify',{
70 | ...
71 | data: function(){
72 | return base64;
73 | },
74 | ...
75 | dataType: 'base64'
76 | });
77 | });
78 | ```
79 |
80 |
83 |
84 | #### Deprecated google gears
85 |
86 | [Franz Buchinger](http://www.picurl.org/blog/author/franz/) has written a
87 | brilliant tutorial on [using JSZip with Google Gears](http://www.picurl.org/blog/2009/11/22/creating-zip-archives-with-gears)
88 | ([part 2](http://www.picurl.org/blog/2009/11/29/gearszipper-part2-adding-support-for-real-files-and-canvas-elements/)).
89 | If you want to let your Gears users download several files at once I really
90 | recommend having a look at some of his [examples](http://picurl.org/gears/zipper/).
91 |
92 |
93 |
94 | ### In nodejs
95 |
96 | JSZip can generate Buffers so you can do the following :
97 |
98 | ```js
99 | var fs = require("fs");
100 | var JSZip = require("jszip");
101 |
102 | var zip = new JSZip();
103 | // zip.file("file", content);
104 | // ... and other manipulations
105 |
106 | zip
107 | .generateNodeStream({type:'nodebuffer',streamFiles:true})
108 | .pipe(fs.createWriteStream('out.zip'))
109 | .on('finish', function () {
110 | // JSZip generates a readable stream with a "end" event,
111 | // but is piped here in a writable stream which emits a "finish" event.
112 | console.log("out.zip written.");
113 | });
114 | ```
115 |
116 |
117 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/documentation/limitations.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Limitations of JSZip"
3 | layout: default
4 | section: limitations
5 | fullpage: true
6 | ---
7 |
8 | ### Not supported features
9 |
10 | Not all features of zip files are supported. Classic zip files will work
11 | but encrypted zip, multi-volume, etc are not supported and the loadAsync()
12 | method will return a failed promise.
13 |
14 |
15 | ### ZIP64 and 32bit integers
16 |
17 | ZIP64 files can be loaded, but only if the zip file is not "too big". ZIP64 uses 64bits integers
18 | but JavaScript represents all numbers as
19 | [64-bit double precision IEEE 754 floating point numbers](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf)
20 | (see section 8.5). So, we have 53bits for integers and
21 | [bitwise operations treat everything as 32bits](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators).
22 | So if all the 64bits integers can fit into 32 bits integers, everything will be
23 | fine. If it's not the case, you will have other problems anyway (see next
24 | limitation).
25 |
26 | ### Performance issues
27 |
28 | An other limitation comes from the browser (and the machine running the
29 | browser). A compressed zip file of 10MB is easily opened by firefox / chrome
30 | / opera / IE10+ but will crash older IE. Also keep in mind that strings in
31 | javascript are encoded in UTF-16 : a 10MB ascii text file will take 20MB of
32 | memory.
33 |
34 | The
35 | [`async` method]({{site.baseurl}}/documentation/api_zipobject/async.html) and the
36 | [`generateAsync` method]({{site.baseurl}}/documentation/api_jszip/generate_async.html)
37 | hold the full result in memory but doesn't freeze the browser. If the result
38 | is too big, and if you can't use the
39 | [`nodeStream` method]({{site.baseurl}}/documentation/api_zipobject/node_stream.html) or the
40 | [`generateNodeStream` method]({{site.baseurl}}/documentation/api_jszip/generate_node_stream.html)
41 | you need to use the underlying
42 | [`StreamHelper`]({{site.baseurl}}/documentation/api_streamhelper.html) to
43 | handle the result chunk by chunk and `pause()`/`resume()` to handle the
44 | backpressure.
45 |
46 | If you're having performance issues, please consider the following :
47 |
48 | * Don't use IE <= 9. Everything is better with typed arrays.
49 | * Use typed arrays (Uint8Array, ArrayBuffer, etc) if possible :
50 | * If you generate a zip file, you should use `type:"uint8array"`
51 | (or blob, arraybuffer, nodebuffer).
52 | * If you load the file from an ajax call, ask your XHR an ArrayBuffer.
53 | Loading a string is asking for troubles.
54 |
55 | Note about compression :
56 | When reading a file, JSZip will store the content without decompressing it.
57 | When generating a compressed file, JSZip will reuse if possible the compressed
58 | content :
59 |
60 | * If you read a zip file compressed with DEFLATE and call `generate` with the
61 | DEFLATE compression, JSZip won't call the compression algorithms (same with
62 | STORE everywhere.)
63 | * If you read a zip file compressed with DEFLATE and call `generate` with the
64 | STORE compression, JSZip will have to decompress everything.
65 |
66 | On IE <=9, typed arrays are not supported and the compression algorithm
67 | will fallback on arrays. In that case, JSZip needs to convert the binary string
68 | into an array, DEFLATE it and convert the result into a binary string.
69 | You don't want that to happen.
70 |
71 | ### The output zip will differ from the input zip
72 |
73 | Reading and generating a zip file won't give you back the same file.
74 | Some data are discarded (file metadata) and other are added (subfolders).
75 |
76 | ### Encodings support
77 |
78 | JSZip only supports UTF-8 natively. A zip file doesn't contain the name of the
79 | encoding used, you need to know it before doing anything.
80 |
81 | #### File name
82 |
83 | If the name of a file inside the zip is encoded with UTF-8 then JSZip can
84 | detect it (Language encoding flag, Unicode Path Extra Field). If not, JSZip
85 | can't detect the encoding used and will generate [Mojibake](https://en.wikipedia.org/wiki/Mojibake).
86 | You can use the [encodeFileName]({{site.baseurl}}/documentation/api_jszip/generate.html)
87 | option and the [decodeFileName]({{site.baseurl}}/documentation/api_jszip/load.html)
88 | option to encode/decode using a custom encoding.
89 |
90 | #### File content
91 |
92 | The `async("string")` method uses UTF-8 to decode the content. If you have a text in
93 | a different encoding, you can get the bytes array with `async("uint8array")` and
94 | decode it with a lib (iconv, iconv-lite, etc) on your side.
95 | To save a text using a non-UTF-8 encoding, do the same : encode it into a
96 | Uint8Array before adding it to JSZip.
97 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/documentation/upgrade_guide.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Upgrade Guide
3 | layout: default
4 | section: main
5 | ---
6 |
7 | ### From 2.x to 3.0.0
8 |
9 | * Deprecated objects/methods has been removed:
10 | * `options.base64` in `generate()` (the base64 type is still valid)
11 | * `options.base64`, `options.binary`, `options.dir`, `options.date`
12 | on `ZipObject` (see the [2.3 upgrade section](#from-222-to-230))
13 | * `JSZip.utils`
14 | * `JSZip.prototype.crc32`, `JSZip.prototype.utf8encode`, `JSZip.prototype.utf8decode`
15 | * `JSZip.base64` (you can get the content of a file directly as a base64 string)
16 | * `JSZip.compressions` has been removed.
17 | * On `ZipObject`, the synchronous getters has been replaced by `async()` and
18 | `nodeStream()`.
19 | * The `generate()` method has been replaced by `generateAsync()` and
20 | `generateNodeStream()`.
21 | * The `type` option in `generate()` is now mandatory.
22 | * The "text" type has been replaced by the "string" type, a binary string is
23 | named "binarystring".
24 | * The `load()` method and the constructor with data (`new JSZip(data)`) have
25 | been replaced by `loadAsync()`.
26 | * When adding a file, the option `createFolders` now defaults to `true`. If
27 | you don't want to create sub folders, set it to false.
28 | * `zip.generateAsync()` and `zip.generateNodeStream()` now depend on the
29 | current folder level.
30 |
31 | ```js
32 | // 2.x
33 | zip.file("test.txt").asText();
34 | // 3.x
35 | zip.file("test.txt").async("string")
36 | .then(function (content) {
37 | // use content
38 | });
39 |
40 |
41 | // 2.x
42 | zip.generate();
43 | // 3.x
44 | zip.generateAsync({type:"uint8array"})
45 | .then(function (content) {
46 | // use content
47 | });
48 |
49 | // 2.x
50 | new JSZip(data);
51 | zip.load(data);
52 | // zip.file(...)
53 | // 3.x
54 | JSZip.loadAsync(data).then(zip) {...};
55 | zip.loadAsync(data).then(zip) {...};
56 | // here, zip won't have (yet) the updated content
57 |
58 | // 2.x
59 | var data = zip.file("img.jpg").asBinary();
60 | var dataURI = "data:image/jpeg;base64," + JSZip.base64.encode(data);
61 | // 3.x
62 | zip.file("img.jpg").async("base64")
63 | .then(function (data64) {
64 | var dataURI = "data:image/jpeg;base64," + data64;
65 | });
66 | ```
67 |
68 | `async` and `loadAsync` use (a polyfill of) promises, you can find
69 | the documentation [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
70 | and a tutorial [here](http://www.html5rocks.com/en/tutorials/es6/promises/).
71 |
72 | It is worth noting that:
73 |
74 | ```js
75 | /*
76 | * JSZip accepts these promise as input
77 | */
78 |
79 | // replace a content with JSZip v2
80 | var content = zip.file("my_file").asText();
81 | content = content.replace(/apples/, 'oranges');
82 | zip.file("my_file", content);
83 |
84 | // replace a content with JSZip v3
85 | var contentPromise = zip.file("my_file").async("text").then(function (content) {
86 | return content.replace(/apples/, 'oranges');
87 | });
88 | zip.file("my_file", contentPromise);
89 |
90 |
91 | /*
92 | * Promises are chainable
93 | */
94 |
95 | // read, update, generate a zip file with JSZip v2
96 | var zip = new JSZip(content);
97 | zip.file("new_file", "new_content");
98 | var blob = zip.generate({type: "blob"});
99 | saveAs(blob, "result.zip");
100 |
101 | // read, update, generate a zip file with JSZip v3
102 | JSZip.loadAsync(content)
103 | .then(function (zip) {
104 | zip.file("new_file", "new_content");
105 | // if you return the zip object, it will be available in the next "then"
106 | return zip;
107 | .then(function (zip) {
108 | // if you return a promise of a blob, promises will "merge": the current
109 | // promise will wait for the other and the next "then" will get the
110 | // blob
111 | return zip.generateAsync({type: "blob"});
112 | .then(function (blob) {
113 | saveAs(blob, "result.zip");
114 | });
115 | ```
116 |
117 | ### From 2.2.2 to 2.3.0
118 |
119 | * On `ZipObject#options`, the attributes `date` and `dir` have been
120 | deprecated and are now on `ZipObject`.
121 | * On `ZipObject#options`, the attributes `base64` and `binary` have been
122 | deprecated.
123 | * `JSZip.base64`, `JSZip.prototype.crc32`, `JSZip.prototype.utf8decode`,
124 | `JSZip.prototype.utf8encode` and `JSZip.utils` have been deprecated.
125 |
126 | ```js
127 | // deprecated
128 | zip.file("test.txt").options.date
129 | zip.file("test.txt").options.dir
130 | // new API
131 | zip.file("test.txt").date
132 | zip.file("test.txt").dir
133 | ```
134 |
135 |
136 | ### From 2.0.0 to 2.1.0
137 |
138 | * The packaging changed : instead of loading jszip.js, jszip-load.js,
139 | jszip-inflate.js, jszip-deflate.js, just include dist/jszip.js or
140 | dist/jszip.min.js.
141 | For AMD loader users : JSZip now registers itself. You just have to put the
142 | file at the right place or configure your loader.
143 |
144 |
145 | ### From 1.x to 2.x
146 |
147 | * `JSZipBase64` has been renamed to `JSZip.base64`.
148 | * The `data` attribute doesn't exist anymore :
149 | use the getters `asText()`, `asBinary()`, etc
150 | * The compression/decompression methods now give their input type with the
151 | `compressInputType` and `uncompressInputType` attributes.
152 |
153 | Example for the data attribute :
154 |
155 | ```js
156 | // before
157 | zip.file("test.txt").data;
158 | zip.files["test.txt"].data;
159 | zip.file("image.png").data;
160 | zip.files["image.png"].data;
161 |
162 | // after
163 | zip.file("test.txt").asText();
164 | zip.files["test.txt"].asText();
165 | zip.file("image.png").asBinary();
166 | zip.files["image.png"].asBinary();
167 | ```
168 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | title: JSZip
3 | layout: default
4 | section: main
5 | ---
6 |
7 |
8 |
9 |
10 | JSZip is a javascript library for creating, reading and editing .zip files, with a
11 | lovely and simple API.
12 |
13 |
14 |
15 |
16 | Current version : v3.1.5
17 |
18 |
19 | License : JSZip is dual-licensed. You may use it under the
20 | MIT license or the GPLv3 license. See
21 | LICENSE.markdown .
22 |
23 |
24 |
25 |
26 |
27 |
28 |
Example
29 |
30 |
57 |
67 |
Run!
68 |
69 |
70 | This browser doesn't support blobs, this demo won't work :(
71 | See
here for more info .
72 |
73 |
74 |
75 |
76 |
Installation
77 |
78 |
79 | With npm : npm install jszip
80 |
81 |
82 | With bower : bower install Stuk/jszip
83 |
84 |
85 | With component : component install Stuk/jszip
86 |
87 |
88 | Manually : download JSZip
89 | and include the file dist/jszip.js
or dist/jszip.min.js
90 |
91 |
92 |
93 | Installed ? Great ! You can now check our
94 | guides and examples !
95 |
96 |
97 |
98 |
99 |
Support
100 |
101 |
102 |
103 | Opera
104 | Firefox
105 | Safari
106 | Chrome
107 | Internet Explorer
108 | Node.js
109 |
110 |
111 | Yes
112 | Yes
113 | Yes
114 | Yes
115 | Yes
116 | Yes
117 |
118 |
119 | Tested with the latest version
120 | Tested with 3.0 / 3.6 / latest version
121 | Tested with the latest version
122 | Tested with the latest version
123 | Tested with IE 6 / 7 / 8 / 9 / 10
124 | Tested with node.js 0.10 / latest version
125 |
126 |
127 |
128 |
Getting help
129 |
130 |
131 | Having trouble ? We'd like to help !
132 |
133 |
134 |
135 | Try the FAQ , it has
136 | answers to common questions.
137 |
138 |
139 | If you're looking for informations about a specific method, try the
140 | documentation .
141 |
142 |
143 | Check the
144 | examples .
145 |
146 |
147 | Report bugs in our
148 | Bug tracker .
149 |
150 |
151 |
152 |
Test status
153 |
154 |
155 | Travis build :
156 |
157 |
158 |
159 |
160 |
161 | Saucelabs build :
162 |
163 |
164 |
165 |
166 |
167 | Live tests :
168 |
169 | See for yourself !
170 |
171 |
172 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/base64.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var utils = require('./utils');
3 | var support = require('./support');
4 | // private property
5 | var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
6 |
7 |
8 | // public method for encoding
9 | exports.encode = function(input) {
10 | var output = [];
11 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
12 | var i = 0, len = input.length, remainingBytes = len;
13 |
14 | var isArray = utils.getTypeOf(input) !== "string";
15 | while (i < input.length) {
16 | remainingBytes = len - i;
17 |
18 | if (!isArray) {
19 | chr1 = input.charCodeAt(i++);
20 | chr2 = i < len ? input.charCodeAt(i++) : 0;
21 | chr3 = i < len ? input.charCodeAt(i++) : 0;
22 | } else {
23 | chr1 = input[i++];
24 | chr2 = i < len ? input[i++] : 0;
25 | chr3 = i < len ? input[i++] : 0;
26 | }
27 |
28 | enc1 = chr1 >> 2;
29 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
30 | enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64;
31 | enc4 = remainingBytes > 2 ? (chr3 & 63) : 64;
32 |
33 | output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));
34 |
35 | }
36 |
37 | return output.join("");
38 | };
39 |
40 | // public method for decoding
41 | exports.decode = function(input) {
42 | var chr1, chr2, chr3;
43 | var enc1, enc2, enc3, enc4;
44 | var i = 0, resultIndex = 0;
45 |
46 | var dataUrlPrefix = "data:";
47 |
48 | if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) {
49 | // This is a common error: people give a data url
50 | // (data:image/png;base64,iVBOR...) with a {base64: true} and
51 | // wonders why things don't work.
52 | // We can detect that the string input looks like a data url but we
53 | // *can't* be sure it is one: removing everything up to the comma would
54 | // be too dangerous.
55 | throw new Error("Invalid base64 input, it looks like a data url.");
56 | }
57 |
58 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
59 |
60 | var totalLength = input.length * 3 / 4;
61 | if(input.charAt(input.length - 1) === _keyStr.charAt(64)) {
62 | totalLength--;
63 | }
64 | if(input.charAt(input.length - 2) === _keyStr.charAt(64)) {
65 | totalLength--;
66 | }
67 | if (totalLength % 1 !== 0) {
68 | // totalLength is not an integer, the length does not match a valid
69 | // base64 content. That can happen if:
70 | // - the input is not a base64 content
71 | // - the input is *almost* a base64 content, with a extra chars at the
72 | // beginning or at the end
73 | // - the input uses a base64 variant (base64url for example)
74 | throw new Error("Invalid base64 input, bad content length.");
75 | }
76 | var output;
77 | if (support.uint8array) {
78 | output = new Uint8Array(totalLength|0);
79 | } else {
80 | output = new Array(totalLength|0);
81 | }
82 |
83 | while (i < input.length) {
84 |
85 | enc1 = _keyStr.indexOf(input.charAt(i++));
86 | enc2 = _keyStr.indexOf(input.charAt(i++));
87 | enc3 = _keyStr.indexOf(input.charAt(i++));
88 | enc4 = _keyStr.indexOf(input.charAt(i++));
89 |
90 | chr1 = (enc1 << 2) | (enc2 >> 4);
91 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
92 | chr3 = ((enc3 & 3) << 6) | enc4;
93 |
94 | output[resultIndex++] = chr1;
95 |
96 | if (enc3 !== 64) {
97 | output[resultIndex++] = chr2;
98 | }
99 | if (enc4 !== 64) {
100 | output[resultIndex++] = chr3;
101 | }
102 |
103 | }
104 |
105 | return output;
106 | };
107 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/compressedObject.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var external = require("./external");
4 | var DataWorker = require('./stream/DataWorker');
5 | var DataLengthProbe = require('./stream/DataLengthProbe');
6 | var Crc32Probe = require('./stream/Crc32Probe');
7 | var DataLengthProbe = require('./stream/DataLengthProbe');
8 |
9 | /**
10 | * Represent a compressed object, with everything needed to decompress it.
11 | * @constructor
12 | * @param {number} compressedSize the size of the data compressed.
13 | * @param {number} uncompressedSize the size of the data after decompression.
14 | * @param {number} crc32 the crc32 of the decompressed file.
15 | * @param {object} compression the type of compression, see lib/compressions.js.
16 | * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data.
17 | */
18 | function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {
19 | this.compressedSize = compressedSize;
20 | this.uncompressedSize = uncompressedSize;
21 | this.crc32 = crc32;
22 | this.compression = compression;
23 | this.compressedContent = data;
24 | }
25 |
26 | CompressedObject.prototype = {
27 | /**
28 | * Create a worker to get the uncompressed content.
29 | * @return {GenericWorker} the worker.
30 | */
31 | getContentWorker : function () {
32 | var worker = new DataWorker(external.Promise.resolve(this.compressedContent))
33 | .pipe(this.compression.uncompressWorker())
34 | .pipe(new DataLengthProbe("data_length"));
35 |
36 | var that = this;
37 | worker.on("end", function () {
38 | if(this.streamInfo['data_length'] !== that.uncompressedSize) {
39 | throw new Error("Bug : uncompressed data size mismatch");
40 | }
41 | });
42 | return worker;
43 | },
44 | /**
45 | * Create a worker to get the compressed content.
46 | * @return {GenericWorker} the worker.
47 | */
48 | getCompressedWorker : function () {
49 | return new DataWorker(external.Promise.resolve(this.compressedContent))
50 | .withStreamInfo("compressedSize", this.compressedSize)
51 | .withStreamInfo("uncompressedSize", this.uncompressedSize)
52 | .withStreamInfo("crc32", this.crc32)
53 | .withStreamInfo("compression", this.compression)
54 | ;
55 | }
56 | };
57 |
58 | /**
59 | * Chain the given worker with other workers to compress the content with the
60 | * given compresion.
61 | * @param {GenericWorker} uncompressedWorker the worker to pipe.
62 | * @param {Object} compression the compression object.
63 | * @param {Object} compressionOptions the options to use when compressing.
64 | * @return {GenericWorker} the new worker compressing the content.
65 | */
66 | CompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) {
67 | return uncompressedWorker
68 | .pipe(new Crc32Probe())
69 | .pipe(new DataLengthProbe("uncompressedSize"))
70 | .pipe(compression.compressWorker(compressionOptions))
71 | .pipe(new DataLengthProbe("compressedSize"))
72 | .withStreamInfo("compression", compression);
73 | };
74 |
75 | module.exports = CompressedObject;
76 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/compressions.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var GenericWorker = require("./stream/GenericWorker");
4 |
5 | exports.STORE = {
6 | magic: "\x00\x00",
7 | compressWorker : function (compressionOptions) {
8 | return new GenericWorker("STORE compression");
9 | },
10 | uncompressWorker : function () {
11 | return new GenericWorker("STORE decompression");
12 | }
13 | };
14 | exports.DEFLATE = require('./flate');
15 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/crc32.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var utils = require('./utils');
4 |
5 | /**
6 | * The following functions come from pako, from pako/lib/zlib/crc32.js
7 | * released under the MIT license, see pako https://github.com/nodeca/pako/
8 | */
9 |
10 | // Use ordinary array, since untyped makes no boost here
11 | function makeTable() {
12 | var c, table = [];
13 |
14 | for(var n =0; n < 256; n++){
15 | c = n;
16 | for(var k =0; k < 8; k++){
17 | c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
18 | }
19 | table[n] = c;
20 | }
21 |
22 | return table;
23 | }
24 |
25 | // Create table on load. Just 255 signed longs. Not a problem.
26 | var crcTable = makeTable();
27 |
28 |
29 | function crc32(crc, buf, len, pos) {
30 | var t = crcTable, end = pos + len;
31 |
32 | crc = crc ^ (-1);
33 |
34 | for (var i = pos; i < end; i++ ) {
35 | crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
36 | }
37 |
38 | return (crc ^ (-1)); // >>> 0;
39 | }
40 |
41 | // That's all for the pako functions.
42 |
43 | /**
44 | * Compute the crc32 of a string.
45 | * This is almost the same as the function crc32, but for strings. Using the
46 | * same function for the two use cases leads to horrible performances.
47 | * @param {Number} crc the starting value of the crc.
48 | * @param {String} str the string to use.
49 | * @param {Number} len the length of the string.
50 | * @param {Number} pos the starting position for the crc32 computation.
51 | * @return {Number} the computed crc32.
52 | */
53 | function crc32str(crc, str, len, pos) {
54 | var t = crcTable, end = pos + len;
55 |
56 | crc = crc ^ (-1);
57 |
58 | for (var i = pos; i < end; i++ ) {
59 | crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF];
60 | }
61 |
62 | return (crc ^ (-1)); // >>> 0;
63 | }
64 |
65 | module.exports = function crc32wrapper(input, crc) {
66 | if (typeof input === "undefined" || !input.length) {
67 | return 0;
68 | }
69 |
70 | var isArray = utils.getTypeOf(input) !== "string";
71 |
72 | if(isArray) {
73 | return crc32(crc|0, input, input.length, 0);
74 | } else {
75 | return crc32str(crc|0, input, input.length, 0);
76 | }
77 | };
78 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/defaults.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | exports.base64 = false;
3 | exports.binary = false;
4 | exports.dir = false;
5 | exports.createFolders = true;
6 | exports.date = null;
7 | exports.compression = null;
8 | exports.compressionOptions = null;
9 | exports.comment = null;
10 | exports.unixPermissions = null;
11 | exports.dosPermissions = null;
12 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/external.js:
--------------------------------------------------------------------------------
1 | /* global Promise */
2 | 'use strict';
3 |
4 | // load the global object first:
5 | // - it should be better integrated in the system (unhandledRejection in node)
6 | // - the environment may have a custom Promise implementation (see zone.js)
7 | var ES6Promise = null;
8 | if (typeof Promise !== "undefined") {
9 | ES6Promise = Promise;
10 | } else {
11 | ES6Promise = require("lie");
12 | }
13 |
14 | /**
15 | * Let the user use/change some implementations.
16 | */
17 | module.exports = {
18 | Promise: ES6Promise
19 | };
20 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/flate.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
3 |
4 | var pako = require("pako");
5 | var utils = require("./utils");
6 | var GenericWorker = require("./stream/GenericWorker");
7 |
8 | var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array";
9 |
10 | exports.magic = "\x08\x00";
11 |
12 | /**
13 | * Create a worker that uses pako to inflate/deflate.
14 | * @constructor
15 | * @param {String} action the name of the pako function to call : either "Deflate" or "Inflate".
16 | * @param {Object} options the options to use when (de)compressing.
17 | */
18 | function FlateWorker(action, options) {
19 | GenericWorker.call(this, "FlateWorker/" + action);
20 |
21 | this._pako = null;
22 | this._pakoAction = action;
23 | this._pakoOptions = options;
24 | // the `meta` object from the last chunk received
25 | // this allow this worker to pass around metadata
26 | this.meta = {};
27 | }
28 |
29 | utils.inherits(FlateWorker, GenericWorker);
30 |
31 | /**
32 | * @see GenericWorker.processChunk
33 | */
34 | FlateWorker.prototype.processChunk = function (chunk) {
35 | this.meta = chunk.meta;
36 | if (this._pako === null) {
37 | this._createPako();
38 | }
39 | this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false);
40 | };
41 |
42 | /**
43 | * @see GenericWorker.flush
44 | */
45 | FlateWorker.prototype.flush = function () {
46 | GenericWorker.prototype.flush.call(this);
47 | if (this._pako === null) {
48 | this._createPako();
49 | }
50 | this._pako.push([], true);
51 | };
52 | /**
53 | * @see GenericWorker.cleanUp
54 | */
55 | FlateWorker.prototype.cleanUp = function () {
56 | GenericWorker.prototype.cleanUp.call(this);
57 | this._pako = null;
58 | };
59 |
60 | /**
61 | * Create the _pako object.
62 | * TODO: lazy-loading this object isn't the best solution but it's the
63 | * quickest. The best solution is to lazy-load the worker list. See also the
64 | * issue #446.
65 | */
66 | FlateWorker.prototype._createPako = function () {
67 | this._pako = new pako[this._pakoAction]({
68 | raw: true,
69 | level: this._pakoOptions.level || -1 // default compression
70 | });
71 | var self = this;
72 | this._pako.onData = function(data) {
73 | self.push({
74 | data : data,
75 | meta : self.meta
76 | });
77 | };
78 | };
79 |
80 | exports.compressWorker = function (compressionOptions) {
81 | return new FlateWorker("Deflate", compressionOptions);
82 | };
83 | exports.uncompressWorker = function () {
84 | return new FlateWorker("Inflate", {});
85 | };
86 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/generate/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var compressions = require('../compressions');
4 | var ZipFileWorker = require('./ZipFileWorker');
5 |
6 | /**
7 | * Find the compression to use.
8 | * @param {String} fileCompression the compression defined at the file level, if any.
9 | * @param {String} zipCompression the compression defined at the load() level.
10 | * @return {Object} the compression object to use.
11 | */
12 | var getCompression = function (fileCompression, zipCompression) {
13 |
14 | var compressionName = fileCompression || zipCompression;
15 | var compression = compressions[compressionName];
16 | if (!compression) {
17 | throw new Error(compressionName + " is not a valid compression method !");
18 | }
19 | return compression;
20 | };
21 |
22 | /**
23 | * Create a worker to generate a zip file.
24 | * @param {JSZip} zip the JSZip instance at the right root level.
25 | * @param {Object} options to generate the zip file.
26 | * @param {String} comment the comment to use.
27 | */
28 | exports.generateWorker = function (zip, options, comment) {
29 |
30 | var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName);
31 | var entriesCount = 0;
32 | try {
33 |
34 | zip.forEach(function (relativePath, file) {
35 | entriesCount++;
36 | var compression = getCompression(file.options.compression, options.compression);
37 | var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};
38 | var dir = file.dir, date = file.date;
39 |
40 | file._compressWorker(compression, compressionOptions)
41 | .withStreamInfo("file", {
42 | name : relativePath,
43 | dir : dir,
44 | date : date,
45 | comment : file.comment || "",
46 | unixPermissions : file.unixPermissions,
47 | dosPermissions : file.dosPermissions
48 | })
49 | .pipe(zipFileWorker);
50 | });
51 | zipFileWorker.entriesCount = entriesCount;
52 | } catch (e) {
53 | zipFileWorker.error(e);
54 | }
55 |
56 | return zipFileWorker;
57 | };
58 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /**
4 | * Representation a of zip file in js
5 | * @constructor
6 | */
7 | function JSZip() {
8 | // if this constructor is used without `new`, it adds `new` before itself:
9 | if(!(this instanceof JSZip)) {
10 | return new JSZip();
11 | }
12 |
13 | if(arguments.length) {
14 | throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
15 | }
16 |
17 | // object containing the files :
18 | // {
19 | // "folder/" : {...},
20 | // "folder/data.txt" : {...}
21 | // }
22 | this.files = {};
23 |
24 | this.comment = null;
25 |
26 | // Where we are in the hierarchy
27 | this.root = "";
28 | this.clone = function() {
29 | var newObj = new JSZip();
30 | for (var i in this) {
31 | if (typeof this[i] !== "function") {
32 | newObj[i] = this[i];
33 | }
34 | }
35 | return newObj;
36 | };
37 | }
38 | JSZip.prototype = require('./object');
39 | JSZip.prototype.loadAsync = require('./load');
40 | JSZip.support = require('./support');
41 | JSZip.defaults = require('./defaults');
42 |
43 | // TODO find a better way to handle this version,
44 | // a require('package.json').version doesn't work with webpack, see #327
45 | JSZip.version = "3.1.5";
46 |
47 | JSZip.loadAsync = function (content, options) {
48 | return new JSZip().loadAsync(content, options);
49 | };
50 |
51 | JSZip.external = require("./external");
52 | module.exports = JSZip;
53 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/license_header.js:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | JSZip v__VERSION__ - A JavaScript class for generating and reading zip files
4 |
5 |
6 | (c) 2009-2016 Stuart Knightley
7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
8 |
9 | JSZip uses the library pako released under the MIT license :
10 | https://github.com/nodeca/pako/blob/master/LICENSE
11 | */
12 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/load.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var utils = require('./utils');
3 | var external = require("./external");
4 | var utf8 = require('./utf8');
5 | var utils = require('./utils');
6 | var ZipEntries = require('./zipEntries');
7 | var Crc32Probe = require('./stream/Crc32Probe');
8 | var nodejsUtils = require("./nodejsUtils");
9 |
10 | /**
11 | * Check the CRC32 of an entry.
12 | * @param {ZipEntry} zipEntry the zip entry to check.
13 | * @return {Promise} the result.
14 | */
15 | function checkEntryCRC32(zipEntry) {
16 | return new external.Promise(function (resolve, reject) {
17 | var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe());
18 | worker.on("error", function (e) {
19 | reject(e);
20 | })
21 | .on("end", function () {
22 | if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
23 | reject(new Error("Corrupted zip : CRC32 mismatch"));
24 | } else {
25 | resolve();
26 | }
27 | })
28 | .resume();
29 | });
30 | }
31 |
32 | module.exports = function(data, options) {
33 | var zip = this;
34 | options = utils.extend(options || {}, {
35 | base64: false,
36 | checkCRC32: false,
37 | optimizedBinaryString: false,
38 | createFolders: false,
39 | decodeFileName: utf8.utf8decode
40 | });
41 |
42 | if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
43 | return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file."));
44 | }
45 |
46 | return utils.prepareContent("the loaded zip file", data, true, options.optimizedBinaryString, options.base64)
47 | .then(function(data) {
48 | var zipEntries = new ZipEntries(options);
49 | zipEntries.load(data);
50 | return zipEntries;
51 | }).then(function checkCRC32(zipEntries) {
52 | var promises = [external.Promise.resolve(zipEntries)];
53 | var files = zipEntries.files;
54 | if (options.checkCRC32) {
55 | for (var i = 0; i < files.length; i++) {
56 | promises.push(checkEntryCRC32(files[i]));
57 | }
58 | }
59 | return external.Promise.all(promises);
60 | }).then(function addFiles(results) {
61 | var zipEntries = results.shift();
62 | var files = zipEntries.files;
63 | for (var i = 0; i < files.length; i++) {
64 | var input = files[i];
65 | zip.file(input.fileNameStr, input.decompressed, {
66 | binary: true,
67 | optimizedBinaryString: true,
68 | date: input.date,
69 | dir: input.dir,
70 | comment : input.fileCommentStr.length ? input.fileCommentStr : null,
71 | unixPermissions : input.unixPermissions,
72 | dosPermissions : input.dosPermissions,
73 | createFolders: options.createFolders
74 | });
75 | }
76 | if (zipEntries.zipComment.length) {
77 | zip.comment = zipEntries.zipComment;
78 | }
79 |
80 | return zip;
81 | });
82 | };
83 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/nodejs/NodejsStreamInputAdapter.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var utils = require('../utils');
4 | var GenericWorker = require('../stream/GenericWorker');
5 |
6 | /**
7 | * A worker that use a nodejs stream as source.
8 | * @constructor
9 | * @param {String} filename the name of the file entry for this stream.
10 | * @param {Readable} stream the nodejs stream.
11 | */
12 | function NodejsStreamInputAdapter(filename, stream) {
13 | GenericWorker.call(this, "Nodejs stream input adapter for " + filename);
14 | this._upstreamEnded = false;
15 | this._bindStream(stream);
16 | }
17 |
18 | utils.inherits(NodejsStreamInputAdapter, GenericWorker);
19 |
20 | /**
21 | * Prepare the stream and bind the callbacks on it.
22 | * Do this ASAP on node 0.10 ! A lazy binding doesn't always work.
23 | * @param {Stream} stream the nodejs stream to use.
24 | */
25 | NodejsStreamInputAdapter.prototype._bindStream = function (stream) {
26 | var self = this;
27 | this._stream = stream;
28 | stream.pause();
29 | stream
30 | .on("data", function (chunk) {
31 | self.push({
32 | data: chunk,
33 | meta : {
34 | percent : 0
35 | }
36 | });
37 | })
38 | .on("error", function (e) {
39 | if(self.isPaused) {
40 | this.generatedError = e;
41 | } else {
42 | self.error(e);
43 | }
44 | })
45 | .on("end", function () {
46 | if(self.isPaused) {
47 | self._upstreamEnded = true;
48 | } else {
49 | self.end();
50 | }
51 | });
52 | };
53 | NodejsStreamInputAdapter.prototype.pause = function () {
54 | if(!GenericWorker.prototype.pause.call(this)) {
55 | return false;
56 | }
57 | this._stream.pause();
58 | return true;
59 | };
60 | NodejsStreamInputAdapter.prototype.resume = function () {
61 | if(!GenericWorker.prototype.resume.call(this)) {
62 | return false;
63 | }
64 |
65 | if(this._upstreamEnded) {
66 | this.end();
67 | } else {
68 | this._stream.resume();
69 | }
70 |
71 | return true;
72 | };
73 |
74 | module.exports = NodejsStreamInputAdapter;
75 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/nodejs/NodejsStreamOutputAdapter.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var Readable = require('readable-stream').Readable;
4 |
5 | var utils = require('../utils');
6 | utils.inherits(NodejsStreamOutputAdapter, Readable);
7 |
8 | /**
9 | * A nodejs stream using a worker as source.
10 | * @see the SourceWrapper in http://nodejs.org/api/stream.html
11 | * @constructor
12 | * @param {StreamHelper} helper the helper wrapping the worker
13 | * @param {Object} options the nodejs stream options
14 | * @param {Function} updateCb the update callback.
15 | */
16 | function NodejsStreamOutputAdapter(helper, options, updateCb) {
17 | Readable.call(this, options);
18 | this._helper = helper;
19 |
20 | var self = this;
21 | helper.on("data", function (data, meta) {
22 | if (!self.push(data)) {
23 | self._helper.pause();
24 | }
25 | if(updateCb) {
26 | updateCb(meta);
27 | }
28 | })
29 | .on("error", function(e) {
30 | self.emit('error', e);
31 | })
32 | .on("end", function () {
33 | self.push(null);
34 | });
35 | }
36 |
37 |
38 | NodejsStreamOutputAdapter.prototype._read = function() {
39 | this._helper.resume();
40 | };
41 |
42 | module.exports = NodejsStreamOutputAdapter;
43 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/nodejsUtils.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 | /**
5 | * True if this is running in Nodejs, will be undefined in a browser.
6 | * In a browser, browserify won't include this file and the whole module
7 | * will be resolved an empty object.
8 | */
9 | isNode : typeof Buffer !== "undefined",
10 | /**
11 | * Create a new nodejs Buffer from an existing content.
12 | * @param {Object} data the data to pass to the constructor.
13 | * @param {String} encoding the encoding to use.
14 | * @return {Buffer} a new Buffer.
15 | */
16 | newBufferFrom: function(data, encoding) {
17 | // XXX We can't use `Buffer.from` which comes from `Uint8Array.from`
18 | // in nodejs v4 (< v.4.5). It's not the expected implementation (and
19 | // has a different signature).
20 | // see https://github.com/nodejs/node/issues/8053
21 | // A condition on nodejs' version won't solve the issue as we don't
22 | // control the Buffer polyfills that may or may not be used.
23 | return new Buffer(data, encoding);
24 | },
25 | /**
26 | * Create a new nodejs Buffer with the specified size.
27 | * @param {Integer} size the size of the buffer.
28 | * @return {Buffer} a new Buffer.
29 | */
30 | allocBuffer: function (size) {
31 | if (Buffer.alloc) {
32 | return Buffer.alloc(size);
33 | } else {
34 | return new Buffer(size);
35 | }
36 | },
37 | /**
38 | * Find out if an object is a Buffer.
39 | * @param {Object} b the object to test.
40 | * @return {Boolean} true if the object is a Buffer, false otherwise.
41 | */
42 | isBuffer : function(b){
43 | return Buffer.isBuffer(b);
44 | },
45 |
46 | isStream : function (obj) {
47 | return obj &&
48 | typeof obj.on === "function" &&
49 | typeof obj.pause === "function" &&
50 | typeof obj.resume === "function";
51 | }
52 | };
53 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/readable-stream-browser.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is used by module bundlers (browserify/webpack/etc) when
3 | * including a stream implementation. We use "readable-stream" to get a
4 | * consistent behavior between nodejs versions but bundlers often have a shim
5 | * for "stream". Using this shim greatly improve the compatibility and greatly
6 | * reduce the final size of the bundle (only one stream implementation, not
7 | * two).
8 | */
9 | module.exports = require("stream");
10 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/ArrayReader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var DataReader = require('./DataReader');
3 | var utils = require('../utils');
4 |
5 | function ArrayReader(data) {
6 | DataReader.call(this, data);
7 | for(var i = 0; i < this.data.length; i++) {
8 | data[i] = data[i] & 0xFF;
9 | }
10 | }
11 | utils.inherits(ArrayReader, DataReader);
12 | /**
13 | * @see DataReader.byteAt
14 | */
15 | ArrayReader.prototype.byteAt = function(i) {
16 | return this.data[this.zero + i];
17 | };
18 | /**
19 | * @see DataReader.lastIndexOfSignature
20 | */
21 | ArrayReader.prototype.lastIndexOfSignature = function(sig) {
22 | var sig0 = sig.charCodeAt(0),
23 | sig1 = sig.charCodeAt(1),
24 | sig2 = sig.charCodeAt(2),
25 | sig3 = sig.charCodeAt(3);
26 | for (var i = this.length - 4; i >= 0; --i) {
27 | if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
28 | return i - this.zero;
29 | }
30 | }
31 |
32 | return -1;
33 | };
34 | /**
35 | * @see DataReader.readAndCheckSignature
36 | */
37 | ArrayReader.prototype.readAndCheckSignature = function (sig) {
38 | var sig0 = sig.charCodeAt(0),
39 | sig1 = sig.charCodeAt(1),
40 | sig2 = sig.charCodeAt(2),
41 | sig3 = sig.charCodeAt(3),
42 | data = this.readData(4);
43 | return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3];
44 | };
45 | /**
46 | * @see DataReader.readData
47 | */
48 | ArrayReader.prototype.readData = function(size) {
49 | this.checkOffset(size);
50 | if(size === 0) {
51 | return [];
52 | }
53 | var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
54 | this.index += size;
55 | return result;
56 | };
57 | module.exports = ArrayReader;
58 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/DataReader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var utils = require('../utils');
3 |
4 | function DataReader(data) {
5 | this.data = data; // type : see implementation
6 | this.length = data.length;
7 | this.index = 0;
8 | this.zero = 0;
9 | }
10 | DataReader.prototype = {
11 | /**
12 | * Check that the offset will not go too far.
13 | * @param {string} offset the additional offset to check.
14 | * @throws {Error} an Error if the offset is out of bounds.
15 | */
16 | checkOffset: function(offset) {
17 | this.checkIndex(this.index + offset);
18 | },
19 | /**
20 | * Check that the specified index will not be too far.
21 | * @param {string} newIndex the index to check.
22 | * @throws {Error} an Error if the index is out of bounds.
23 | */
24 | checkIndex: function(newIndex) {
25 | if (this.length < this.zero + newIndex || newIndex < 0) {
26 | throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
27 | }
28 | },
29 | /**
30 | * Change the index.
31 | * @param {number} newIndex The new index.
32 | * @throws {Error} if the new index is out of the data.
33 | */
34 | setIndex: function(newIndex) {
35 | this.checkIndex(newIndex);
36 | this.index = newIndex;
37 | },
38 | /**
39 | * Skip the next n bytes.
40 | * @param {number} n the number of bytes to skip.
41 | * @throws {Error} if the new index is out of the data.
42 | */
43 | skip: function(n) {
44 | this.setIndex(this.index + n);
45 | },
46 | /**
47 | * Get the byte at the specified index.
48 | * @param {number} i the index to use.
49 | * @return {number} a byte.
50 | */
51 | byteAt: function(i) {
52 | // see implementations
53 | },
54 | /**
55 | * Get the next number with a given byte size.
56 | * @param {number} size the number of bytes to read.
57 | * @return {number} the corresponding number.
58 | */
59 | readInt: function(size) {
60 | var result = 0,
61 | i;
62 | this.checkOffset(size);
63 | for (i = this.index + size - 1; i >= this.index; i--) {
64 | result = (result << 8) + this.byteAt(i);
65 | }
66 | this.index += size;
67 | return result;
68 | },
69 | /**
70 | * Get the next string with a given byte size.
71 | * @param {number} size the number of bytes to read.
72 | * @return {string} the corresponding string.
73 | */
74 | readString: function(size) {
75 | return utils.transformTo("string", this.readData(size));
76 | },
77 | /**
78 | * Get raw data without conversion, bytes.
79 | * @param {number} size the number of bytes to read.
80 | * @return {Object} the raw data, implementation specific.
81 | */
82 | readData: function(size) {
83 | // see implementations
84 | },
85 | /**
86 | * Find the last occurence of a zip signature (4 bytes).
87 | * @param {string} sig the signature to find.
88 | * @return {number} the index of the last occurence, -1 if not found.
89 | */
90 | lastIndexOfSignature: function(sig) {
91 | // see implementations
92 | },
93 | /**
94 | * Read the signature (4 bytes) at the current position and compare it with sig.
95 | * @param {string} sig the expected signature
96 | * @return {boolean} true if the signature matches, false otherwise.
97 | */
98 | readAndCheckSignature: function(sig) {
99 | // see implementations
100 | },
101 | /**
102 | * Get the next date.
103 | * @return {Date} the date.
104 | */
105 | readDate: function() {
106 | var dostime = this.readInt(4);
107 | return new Date(Date.UTC(
108 | ((dostime >> 25) & 0x7f) + 1980, // year
109 | ((dostime >> 21) & 0x0f) - 1, // month
110 | (dostime >> 16) & 0x1f, // day
111 | (dostime >> 11) & 0x1f, // hour
112 | (dostime >> 5) & 0x3f, // minute
113 | (dostime & 0x1f) << 1)); // second
114 | }
115 | };
116 | module.exports = DataReader;
117 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/NodeBufferReader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var Uint8ArrayReader = require('./Uint8ArrayReader');
3 | var utils = require('../utils');
4 |
5 | function NodeBufferReader(data) {
6 | Uint8ArrayReader.call(this, data);
7 | }
8 | utils.inherits(NodeBufferReader, Uint8ArrayReader);
9 |
10 | /**
11 | * @see DataReader.readData
12 | */
13 | NodeBufferReader.prototype.readData = function(size) {
14 | this.checkOffset(size);
15 | var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
16 | this.index += size;
17 | return result;
18 | };
19 | module.exports = NodeBufferReader;
20 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/StringReader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var DataReader = require('./DataReader');
3 | var utils = require('../utils');
4 |
5 | function StringReader(data) {
6 | DataReader.call(this, data);
7 | }
8 | utils.inherits(StringReader, DataReader);
9 | /**
10 | * @see DataReader.byteAt
11 | */
12 | StringReader.prototype.byteAt = function(i) {
13 | return this.data.charCodeAt(this.zero + i);
14 | };
15 | /**
16 | * @see DataReader.lastIndexOfSignature
17 | */
18 | StringReader.prototype.lastIndexOfSignature = function(sig) {
19 | return this.data.lastIndexOf(sig) - this.zero;
20 | };
21 | /**
22 | * @see DataReader.readAndCheckSignature
23 | */
24 | StringReader.prototype.readAndCheckSignature = function (sig) {
25 | var data = this.readData(4);
26 | return sig === data;
27 | };
28 | /**
29 | * @see DataReader.readData
30 | */
31 | StringReader.prototype.readData = function(size) {
32 | this.checkOffset(size);
33 | // this will work because the constructor applied the "& 0xff" mask.
34 | var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
35 | this.index += size;
36 | return result;
37 | };
38 | module.exports = StringReader;
39 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/Uint8ArrayReader.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var ArrayReader = require('./ArrayReader');
3 | var utils = require('../utils');
4 |
5 | function Uint8ArrayReader(data) {
6 | ArrayReader.call(this, data);
7 | }
8 | utils.inherits(Uint8ArrayReader, ArrayReader);
9 | /**
10 | * @see DataReader.readData
11 | */
12 | Uint8ArrayReader.prototype.readData = function(size) {
13 | this.checkOffset(size);
14 | if(size === 0) {
15 | // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
16 | return new Uint8Array(0);
17 | }
18 | var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);
19 | this.index += size;
20 | return result;
21 | };
22 | module.exports = Uint8ArrayReader;
23 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/reader/readerFor.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var utils = require('../utils');
4 | var support = require('../support');
5 | var ArrayReader = require('./ArrayReader');
6 | var StringReader = require('./StringReader');
7 | var NodeBufferReader = require('./NodeBufferReader');
8 | var Uint8ArrayReader = require('./Uint8ArrayReader');
9 |
10 | /**
11 | * Create a reader adapted to the data.
12 | * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read.
13 | * @return {DataReader} the data reader.
14 | */
15 | module.exports = function (data) {
16 | var type = utils.getTypeOf(data);
17 | utils.checkSupport(type);
18 | if (type === "string" && !support.uint8array) {
19 | return new StringReader(data);
20 | }
21 | if (type === "nodebuffer") {
22 | return new NodeBufferReader(data);
23 | }
24 | if (support.uint8array) {
25 | return new Uint8ArrayReader(utils.transformTo("uint8array", data));
26 | }
27 | return new ArrayReader(utils.transformTo("array", data));
28 | };
29 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/signature.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | exports.LOCAL_FILE_HEADER = "PK\x03\x04";
3 | exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
4 | exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
5 | exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
6 | exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
7 | exports.DATA_DESCRIPTOR = "PK\x07\x08";
8 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/stream/ConvertWorker.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var GenericWorker = require('./GenericWorker');
4 | var utils = require('../utils');
5 |
6 | /**
7 | * A worker which convert chunks to a specified type.
8 | * @constructor
9 | * @param {String} destType the destination type.
10 | */
11 | function ConvertWorker(destType) {
12 | GenericWorker.call(this, "ConvertWorker to " + destType);
13 | this.destType = destType;
14 | }
15 | utils.inherits(ConvertWorker, GenericWorker);
16 |
17 | /**
18 | * @see GenericWorker.processChunk
19 | */
20 | ConvertWorker.prototype.processChunk = function (chunk) {
21 | this.push({
22 | data : utils.transformTo(this.destType, chunk.data),
23 | meta : chunk.meta
24 | });
25 | };
26 | module.exports = ConvertWorker;
27 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/stream/Crc32Probe.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var GenericWorker = require('./GenericWorker');
4 | var crc32 = require('../crc32');
5 | var utils = require('../utils');
6 |
7 | /**
8 | * A worker which calculate the crc32 of the data flowing through.
9 | * @constructor
10 | */
11 | function Crc32Probe() {
12 | GenericWorker.call(this, "Crc32Probe");
13 | this.withStreamInfo("crc32", 0);
14 | }
15 | utils.inherits(Crc32Probe, GenericWorker);
16 |
17 | /**
18 | * @see GenericWorker.processChunk
19 | */
20 | Crc32Probe.prototype.processChunk = function (chunk) {
21 | this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);
22 | this.push(chunk);
23 | };
24 | module.exports = Crc32Probe;
25 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/stream/DataLengthProbe.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var utils = require('../utils');
4 | var GenericWorker = require('./GenericWorker');
5 |
6 | /**
7 | * A worker which calculate the total length of the data flowing through.
8 | * @constructor
9 | * @param {String} propName the name used to expose the length
10 | */
11 | function DataLengthProbe(propName) {
12 | GenericWorker.call(this, "DataLengthProbe for " + propName);
13 | this.propName = propName;
14 | this.withStreamInfo(propName, 0);
15 | }
16 | utils.inherits(DataLengthProbe, GenericWorker);
17 |
18 | /**
19 | * @see GenericWorker.processChunk
20 | */
21 | DataLengthProbe.prototype.processChunk = function (chunk) {
22 | if(chunk) {
23 | var length = this.streamInfo[this.propName] || 0;
24 | this.streamInfo[this.propName] = length + chunk.data.length;
25 | }
26 | GenericWorker.prototype.processChunk.call(this, chunk);
27 | };
28 | module.exports = DataLengthProbe;
29 |
30 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/stream/DataWorker.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var utils = require('../utils');
4 | var GenericWorker = require('./GenericWorker');
5 |
6 | // the size of the generated chunks
7 | // TODO expose this as a public variable
8 | var DEFAULT_BLOCK_SIZE = 16 * 1024;
9 |
10 | /**
11 | * A worker that reads a content and emits chunks.
12 | * @constructor
13 | * @param {Promise} dataP the promise of the data to split
14 | */
15 | function DataWorker(dataP) {
16 | GenericWorker.call(this, "DataWorker");
17 | var self = this;
18 | this.dataIsReady = false;
19 | this.index = 0;
20 | this.max = 0;
21 | this.data = null;
22 | this.type = "";
23 |
24 | this._tickScheduled = false;
25 |
26 | dataP.then(function (data) {
27 | self.dataIsReady = true;
28 | self.data = data;
29 | self.max = data && data.length || 0;
30 | self.type = utils.getTypeOf(data);
31 | if(!self.isPaused) {
32 | self._tickAndRepeat();
33 | }
34 | }, function (e) {
35 | self.error(e);
36 | });
37 | }
38 |
39 | utils.inherits(DataWorker, GenericWorker);
40 |
41 | /**
42 | * @see GenericWorker.cleanUp
43 | */
44 | DataWorker.prototype.cleanUp = function () {
45 | GenericWorker.prototype.cleanUp.call(this);
46 | this.data = null;
47 | };
48 |
49 | /**
50 | * @see GenericWorker.resume
51 | */
52 | DataWorker.prototype.resume = function () {
53 | if(!GenericWorker.prototype.resume.call(this)) {
54 | return false;
55 | }
56 |
57 | if (!this._tickScheduled && this.dataIsReady) {
58 | this._tickScheduled = true;
59 | utils.delay(this._tickAndRepeat, [], this);
60 | }
61 | return true;
62 | };
63 |
64 | /**
65 | * Trigger a tick a schedule an other call to this function.
66 | */
67 | DataWorker.prototype._tickAndRepeat = function() {
68 | this._tickScheduled = false;
69 | if(this.isPaused || this.isFinished) {
70 | return;
71 | }
72 | this._tick();
73 | if(!this.isFinished) {
74 | utils.delay(this._tickAndRepeat, [], this);
75 | this._tickScheduled = true;
76 | }
77 | };
78 |
79 | /**
80 | * Read and push a chunk.
81 | */
82 | DataWorker.prototype._tick = function() {
83 |
84 | if(this.isPaused || this.isFinished) {
85 | return false;
86 | }
87 |
88 | var size = DEFAULT_BLOCK_SIZE;
89 | var data = null, nextIndex = Math.min(this.max, this.index + size);
90 | if (this.index >= this.max) {
91 | // EOF
92 | return this.end();
93 | } else {
94 | switch(this.type) {
95 | case "string":
96 | data = this.data.substring(this.index, nextIndex);
97 | break;
98 | case "uint8array":
99 | data = this.data.subarray(this.index, nextIndex);
100 | break;
101 | case "array":
102 | case "nodebuffer":
103 | data = this.data.slice(this.index, nextIndex);
104 | break;
105 | }
106 | this.index = nextIndex;
107 | return this.push({
108 | data : data,
109 | meta : {
110 | percent : this.max ? this.index / this.max * 100 : 0
111 | }
112 | });
113 | }
114 | };
115 |
116 | module.exports = DataWorker;
117 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/support.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | exports.base64 = true;
4 | exports.array = true;
5 | exports.string = true;
6 | exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
7 | exports.nodebuffer = typeof Buffer !== "undefined";
8 | // contains true if JSZip can read/generate Uint8Array, false otherwise.
9 | exports.uint8array = typeof Uint8Array !== "undefined";
10 |
11 | if (typeof ArrayBuffer === "undefined") {
12 | exports.blob = false;
13 | }
14 | else {
15 | var buffer = new ArrayBuffer(0);
16 | try {
17 | exports.blob = new Blob([buffer], {
18 | type: "application/zip"
19 | }).size === 0;
20 | }
21 | catch (e) {
22 | try {
23 | var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
24 | var builder = new Builder();
25 | builder.append(buffer);
26 | exports.blob = builder.getBlob('application/zip').size === 0;
27 | }
28 | catch (e) {
29 | exports.blob = false;
30 | }
31 | }
32 | }
33 |
34 | try {
35 | exports.nodestream = !!require('readable-stream').Readable;
36 | } catch(e) {
37 | exports.nodestream = false;
38 | }
39 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/lib/zipObject.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var StreamHelper = require('./stream/StreamHelper');
4 | var DataWorker = require('./stream/DataWorker');
5 | var utf8 = require('./utf8');
6 | var CompressedObject = require('./compressedObject');
7 | var GenericWorker = require('./stream/GenericWorker');
8 |
9 | /**
10 | * A simple object representing a file in the zip file.
11 | * @constructor
12 | * @param {string} name the name of the file
13 | * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
14 | * @param {Object} options the options of the file
15 | */
16 | var ZipObject = function(name, data, options) {
17 | this.name = name;
18 | this.dir = options.dir;
19 | this.date = options.date;
20 | this.comment = options.comment;
21 | this.unixPermissions = options.unixPermissions;
22 | this.dosPermissions = options.dosPermissions;
23 |
24 | this._data = data;
25 | this._dataBinary = options.binary;
26 | // keep only the compression
27 | this.options = {
28 | compression : options.compression,
29 | compressionOptions : options.compressionOptions
30 | };
31 | };
32 |
33 | ZipObject.prototype = {
34 | /**
35 | * Create an internal stream for the content of this object.
36 | * @param {String} type the type of each chunk.
37 | * @return StreamHelper the stream.
38 | */
39 | internalStream: function (type) {
40 | var result = null, outputType = "string";
41 | try {
42 | if (!type) {
43 | throw new Error("No output type specified.");
44 | }
45 | outputType = type.toLowerCase();
46 | var askUnicodeString = outputType === "string" || outputType === "text";
47 | if (outputType === "binarystring" || outputType === "text") {
48 | outputType = "string";
49 | }
50 | result = this._decompressWorker();
51 |
52 | var isUnicodeString = !this._dataBinary;
53 |
54 | if (isUnicodeString && !askUnicodeString) {
55 | result = result.pipe(new utf8.Utf8EncodeWorker());
56 | }
57 | if (!isUnicodeString && askUnicodeString) {
58 | result = result.pipe(new utf8.Utf8DecodeWorker());
59 | }
60 | } catch (e) {
61 | result = new GenericWorker("error");
62 | result.error(e);
63 | }
64 |
65 | return new StreamHelper(result, outputType, "");
66 | },
67 |
68 | /**
69 | * Prepare the content in the asked type.
70 | * @param {String} type the type of the result.
71 | * @param {Function} onUpdate a function to call on each internal update.
72 | * @return Promise the promise of the result.
73 | */
74 | async: function (type, onUpdate) {
75 | return this.internalStream(type).accumulate(onUpdate);
76 | },
77 |
78 | /**
79 | * Prepare the content as a nodejs stream.
80 | * @param {String} type the type of each chunk.
81 | * @param {Function} onUpdate a function to call on each internal update.
82 | * @return Stream the stream.
83 | */
84 | nodeStream: function (type, onUpdate) {
85 | return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate);
86 | },
87 |
88 | /**
89 | * Return a worker for the compressed content.
90 | * @private
91 | * @param {Object} compression the compression object to use.
92 | * @param {Object} compressionOptions the options to use when compressing.
93 | * @return Worker the worker.
94 | */
95 | _compressWorker: function (compression, compressionOptions) {
96 | if (
97 | this._data instanceof CompressedObject &&
98 | this._data.compression.magic === compression.magic
99 | ) {
100 | return this._data.getCompressedWorker();
101 | } else {
102 | var result = this._decompressWorker();
103 | if(!this._dataBinary) {
104 | result = result.pipe(new utf8.Utf8EncodeWorker());
105 | }
106 | return CompressedObject.createWorkerFrom(result, compression, compressionOptions);
107 | }
108 | },
109 | /**
110 | * Return a worker for the decompressed content.
111 | * @private
112 | * @return Worker the worker.
113 | */
114 | _decompressWorker : function () {
115 | if (this._data instanceof CompressedObject) {
116 | return this._data.getContentWorker();
117 | } else if (this._data instanceof GenericWorker) {
118 | return this._data;
119 | } else {
120 | return new DataWorker(this._data);
121 | }
122 | }
123 | };
124 |
125 | var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"];
126 | var removedFn = function () {
127 | throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
128 | };
129 |
130 | for(var i = 0; i < removedMethods.length; i++) {
131 | ZipObject.prototype[removedMethods[i]] = removedFn;
132 | }
133 | module.exports = ZipObject;
134 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jszip",
3 | "version": "3.1.5",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "colors": {
8 | "version": "0.6.2",
9 | "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
10 | "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
11 | "dev": true
12 | },
13 | "core-js": {
14 | "version": "3.0.0",
15 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz",
16 | "integrity": "sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ=="
17 | },
18 | "es6-promise": {
19 | "version": "4.2.6",
20 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
21 | "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q=="
22 | },
23 | "immediate": {
24 | "version": "3.0.6",
25 | "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
26 | "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
27 | },
28 | "inherits": {
29 | "version": "2.0.3",
30 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
31 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
32 | },
33 | "jszip-utils": {
34 | "version": "0.0.2",
35 | "resolved": "https://registry.npmjs.org/jszip-utils/-/jszip-utils-0.0.2.tgz",
36 | "integrity": "sha1-RX1cvKYKHC4HBunaK1ROjnvFC/g=",
37 | "dev": true
38 | },
39 | "lie": {
40 | "version": "3.3.0",
41 | "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
42 | "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
43 | "requires": {
44 | "immediate": "~3.0.5"
45 | }
46 | },
47 | "optimist": {
48 | "version": "0.6.1",
49 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
50 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
51 | "dev": true,
52 | "requires": {
53 | "minimist": "~0.0.1",
54 | "wordwrap": "~0.0.2"
55 | },
56 | "dependencies": {
57 | "minimist": {
58 | "version": "0.0.10",
59 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
60 | "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
61 | "dev": true
62 | }
63 | }
64 | },
65 | "pako": {
66 | "version": "1.0.10",
67 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz",
68 | "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw=="
69 | },
70 | "qunit-cli": {
71 | "version": "0.2.0",
72 | "resolved": "https://registry.npmjs.org/qunit-cli/-/qunit-cli-0.2.0.tgz",
73 | "integrity": "sha1-f+sPoj17WLYMHDU09qdLLJxSVss=",
74 | "dev": true,
75 | "requires": {
76 | "colors": "*",
77 | "object-assign": "^2.0.0",
78 | "optimist": ">=0.3",
79 | "qunitjs": "^1.15.0"
80 | },
81 | "dependencies": {
82 | "object-assign": {
83 | "version": "2.1.1",
84 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz",
85 | "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=",
86 | "dev": true
87 | }
88 | }
89 | },
90 | "qunitjs": {
91 | "version": "1.23.1",
92 | "resolved": "https://registry.npmjs.org/qunitjs/-/qunitjs-1.23.1.tgz",
93 | "integrity": "sha1-GXHPl6yb4Bpk0jFVCNLkjm/U5xk=",
94 | "dev": true
95 | },
96 | "readable-stream": {
97 | "version": "3.2.0",
98 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz",
99 | "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==",
100 | "requires": {
101 | "inherits": "^2.0.3",
102 | "string_decoder": "^1.1.1",
103 | "util-deprecate": "^1.0.1"
104 | }
105 | },
106 | "safe-buffer": {
107 | "version": "5.1.1",
108 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
109 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
110 | },
111 | "string_decoder": {
112 | "version": "1.2.0",
113 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
114 | "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
115 | "requires": {
116 | "safe-buffer": "~5.1.0"
117 | }
118 | },
119 | "util-deprecate": {
120 | "version": "1.0.2",
121 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
122 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
123 | },
124 | "wordwrap": {
125 | "version": "0.0.2",
126 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
127 | "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
128 | "dev": true
129 | }
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jszip",
3 | "version": "3.1.5",
4 | "author": "Stuart Knightley ",
5 | "description": "Create, read and edit .zip files with JavaScript http://stuartk.com/jszip",
6 | "scripts": {
7 | "test": "npm run test-node && npm run test-browser",
8 | "test-node": "qunit-cli -c test/helpers/test-utils.js test/helpers/node-test-utils.js test/asserts/*.js",
9 | "test-browser": "grunt build && grunt test",
10 | "lint": "grunt jshint"
11 | },
12 | "contributors": [
13 | {
14 | "name": "Franz Buchinger"
15 | },
16 | {
17 | "name": "António Afonso"
18 | },
19 | {
20 | "name": "David Duponchel"
21 | },
22 | {
23 | "name": "yiminghe"
24 | }
25 | ],
26 | "main": "./lib/index",
27 | "browser": {
28 | "readable-stream": "./lib/readable-stream-browser.js"
29 | },
30 | "repository": {
31 | "type": "git",
32 | "url": "https://github.com/Stuk/jszip.git"
33 | },
34 | "keywords": [
35 | "zip",
36 | "deflate",
37 | "inflate"
38 | ],
39 | "devDependencies": {
40 | "grunt": "~1.0.4",
41 | "grunt-cli": "~1.3.2",
42 | "grunt-saucelabs": "9.0.1",
43 | "grunt-contrib-connect": "2.0.0",
44 | "jshint": "~2.10.2",
45 | "browserify": "~16.2.3",
46 | "grunt-browserify": "~5.3.0",
47 | "grunt-contrib-jshint": "~2.1.0",
48 | "grunt-contrib-qunit": "~3.1.0",
49 | "grunt-contrib-uglify": "~4.0.1",
50 | "phantomjs-prebuilt": "2.1.16",
51 | "jszip-utils": "~0.0.2",
52 | "package-json-versionify": "1.0.4",
53 | "qunit-cli": "~0.2.0",
54 | "qunitjs": "~2.4.1",
55 | "tmp": "0.1.0"
56 | },
57 | "dependencies": {
58 | "core-js": "~3.0.0",
59 | "es6-promise": "~4.2.6",
60 | "lie": "~3.3.0",
61 | "pako": "~1.0.10",
62 | "readable-stream": "~3.2.0"
63 | },
64 | "license": "(MIT OR GPL-3.0)"
65 | }
66 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/constructor.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("constructor");
6 |
7 | test("JSZip exists", function(assert){
8 | assert.ok(JSZip, "JSZip exists");
9 | });
10 |
11 | test("new JSZip()", function(assert){
12 | var zip = new JSZip();
13 | assert.ok(zip instanceof JSZip, "Constructor works");
14 | });
15 |
16 | test("JSZip()", function(assert){
17 | var zip = JSZip(); // jshint ignore:line
18 | assert.ok(zip instanceof JSZip, "Constructor adds `new` before itself where necessary");
19 | });
20 |
21 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/delete.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("delete");
6 |
7 | JSZipTestUtils.testZipFile("Delete file", "ref/text.zip", function(expected) {
8 | var zip = new JSZip();
9 | zip.file("Remove.txt", "This file should be deleted\n");
10 | zip.file("Hello.txt", "Hello World\n");
11 | zip.remove("Remove.txt");
12 | stop();
13 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
14 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
15 | start();
16 | })['catch'](JSZipTestUtils.assertNoError);
17 | });
18 |
19 | JSZipTestUtils.testZipFile("Delete file in folder", "ref/folder.zip", function(expected) {
20 | var zip = new JSZip();
21 | zip.folder("folder").file("Remove.txt", "This folder and file should be deleted\n");
22 | zip.remove("folder/Remove.txt");
23 | stop();
24 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
25 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
26 | start();
27 | })['catch'](JSZipTestUtils.assertNoError);
28 | });
29 |
30 | JSZipTestUtils.testZipFile("Delete file in folder, with a relative path", "ref/folder.zip", function(expected) {
31 | var zip = new JSZip();
32 | var folder = zip.folder("folder");
33 | folder.file("Remove.txt", "This folder and file should be deleted\n");
34 | folder.remove("Remove.txt");
35 | stop();
36 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
37 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
38 | start();
39 | })['catch'](JSZipTestUtils.assertNoError);
40 | });
41 |
42 | JSZipTestUtils.testZipFile("Delete folder", "ref/text.zip", function(expected) {
43 | var zip = new JSZip();
44 | zip.folder("remove").file("Remove.txt", "This folder and file should be deleted\n");
45 | zip.file("Hello.txt", "Hello World\n");
46 | zip.remove("remove");
47 | stop();
48 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
49 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
50 | start();
51 | })['catch'](JSZipTestUtils.assertNoError);
52 | });
53 |
54 | JSZipTestUtils.testZipFile("Delete folder with a final /", "ref/text.zip", function(expected) {
55 | var zip = new JSZip();
56 | zip.folder("remove").file("Remove.txt", "This folder and file should be deleted\n");
57 | zip.file("Hello.txt", "Hello World\n");
58 | zip.remove("remove/");
59 | stop();
60 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
61 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
62 | start();
63 | })['catch'](JSZipTestUtils.assertNoError);
64 | });
65 |
66 | JSZipTestUtils.testZipFile("Delete unknown path", "ref/text.zip", function(expected) {
67 | var zip = new JSZip();
68 | zip.file("Hello.txt", "Hello World\n");
69 | zip.remove("unknown_file");
70 | zip.remove("unknown_folder/Hello.txt");
71 | stop();
72 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
73 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
74 | start();
75 | })['catch'](JSZipTestUtils.assertNoError);
76 | });
77 |
78 | JSZipTestUtils.testZipFile("Delete nested folders", "ref/text.zip", function(expected) {
79 | var zip = new JSZip();
80 | zip.folder("remove").file("Remove.txt", "This folder and file should be deleted\n");
81 | zip.folder("remove/second").file("Sub.txt", "This should be removed");
82 | zip.file("remove/second/another.txt", "Another file");
83 | zip.file("Hello.txt", "Hello World\n");
84 | zip.remove("remove");
85 | stop();
86 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
87 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
88 | start();
89 | })['catch'](JSZipTestUtils.assertNoError);
90 | });
91 |
92 | JSZipTestUtils.testZipFile("Delete nested folders from relative path", "ref/folder.zip", function(expected) {
93 | var zip = new JSZip();
94 | zip.folder("folder");
95 | zip.folder("folder/1/2/3");
96 | zip.folder("folder").remove("1");
97 | stop();
98 | zip.generateAsync({type:"binarystring"}).then(function(actual) {
99 | ok(JSZipTestUtils.similar(actual, expected, JSZipTestUtils.MAX_BYTES_DIFFERENCE_PER_ZIP_ENTRY) , "Generated ZIP matches reference ZIP");
100 | JSZipTestUtils.checkGenerateStability(actual);
101 | start();
102 | })['catch'](JSZipTestUtils.assertNoError);
103 | });
104 |
105 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/deprecated.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("deprecated");
6 |
7 | test("Removed load method throws an exception", function(assert) {
8 | var file = JSZipTestUtils.createZipAll().file("Hello.txt");
9 | assert.throws(
10 | function() {
11 | new JSZip().load("");
12 | },
13 | /upgrade guide/,
14 | "load() throws an exception"
15 | );
16 | });
17 | test("Removed constructor with data throws an exception", function(assert) {
18 | var file = JSZipTestUtils.createZipAll().file("Hello.txt");
19 | assert.throws(
20 | function() {
21 | var zip = new JSZip("");
22 | },
23 | /upgrade guide/,
24 | "new JSZip(data) throws an exception"
25 | );
26 | });
27 | test("Removed asText method throws an exception", function(assert) {
28 | var file = JSZipTestUtils.createZipAll().file("Hello.txt");
29 | assert.throws(
30 | function() {
31 | file.asText();
32 | },
33 | /upgrade guide/,
34 | "file.asText() throws an exception"
35 | );
36 | });
37 | test("Removed generate method throws an exception", function(assert) {
38 | var file = JSZipTestUtils.createZipAll().file("Hello.txt");
39 | assert.throws(
40 | function() {
41 | new JSZip().generate({type:"string"});
42 | },
43 | /upgrade guide/,
44 | "generate() throws an exception"
45 | );
46 | });
47 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/external.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils,Promise */
3 | 'use strict';
4 |
5 | QUnit.module("external");
6 |
7 | /**
8 | * Creates a wrapper around an existing Promise implementation to count
9 | * calls and detect custom implementations.
10 | * @param {Promise} OriginalPromise the promise to wrap
11 | * @return {Promise} the wrapped promise
12 | */
13 | function createPromiseProxy(OriginalPromise) {
14 | function MyShinyPromise (input) {
15 | if (input.then) { // thenable, we wrap it
16 | this._promise = input;
17 | } else { // executor
18 | this._promise = new OriginalPromise(input);
19 | }
20 | MyShinyPromise.calls++;
21 | }
22 | MyShinyPromise.calls = 0;
23 | MyShinyPromise.prototype = {
24 | then: function (onFulfilled, onRejected) {
25 | return new MyShinyPromise(this._promise.then(onFulfilled, onRejected));
26 | },
27 | "catch": function (onRejected) {
28 | return new MyShinyPromise(this._promise['catch'](onRejected));
29 | },
30 | isACustomImplementation: true
31 | };
32 |
33 | MyShinyPromise.resolve = function (value) {
34 | return new MyShinyPromise(OriginalPromise.resolve(value));
35 | };
36 | MyShinyPromise.reject = function (value) {
37 | return new MyShinyPromise(OriginalPromise.reject(value));
38 | };
39 | MyShinyPromise.all = function (value) {
40 | return new MyShinyPromise(OriginalPromise.all(value));
41 | };
42 | return MyShinyPromise;
43 | }
44 |
45 | test("JSZip.external.Promise", function (assert) {
46 | assert.ok(JSZip.external.Promise, "JSZip.external.Promise is defined");
47 | assert.ok(JSZip.external.Promise.resolve, "JSZip.external.Promise looks like a Promise");
48 | assert.ok(JSZip.external.Promise.reject, "JSZip.external.Promise looks like a Promise");
49 | });
50 |
51 | test("load JSZip doesn't override the global Promise", function (assert) {
52 | if (typeof Promise !== "undefined"){
53 | assert.equal(Promise, JSZipTestUtils.oldPromise, "the previous Promise didn't change");
54 | assert.equal(Promise, JSZip.external.Promise, "JSZip.external.Promise reused the global Promise");
55 | } else {
56 | assert.ok(JSZip.external.Promise, "JSZip.external.Promise is defined even if the global Promise doesn't exist");
57 | }
58 | });
59 |
60 | test("external.Promise can be replaced in .async()", function (assert) {
61 | var done = assert.async();
62 | var OriginalPromise = JSZip.external.Promise;
63 | var MyShinyPromise = createPromiseProxy(OriginalPromise);
64 |
65 | JSZip.external.Promise = MyShinyPromise;
66 |
67 | var promise = JSZipTestUtils.createZipAll().file("Hello.txt").async("string").then(function (result) {
68 | ok(MyShinyPromise.calls > 0, "at least 1 call of the new Promise");
69 | JSZip.external.Promise = OriginalPromise;
70 | done();
71 | })['catch'](JSZipTestUtils.assertNoError);
72 |
73 | assert.ok(promise.isACustomImplementation, "the custom implementation is used");
74 | });
75 |
76 | test("external.Promise can be replaced in .generateAsync()", function (assert) {
77 | var done = assert.async();
78 | var OriginalPromise = JSZip.external.Promise;
79 | var MyShinyPromise = createPromiseProxy(OriginalPromise);
80 |
81 | JSZip.external.Promise = MyShinyPromise;
82 |
83 | var promise = JSZipTestUtils.createZipAll().generateAsync({type:"string"}).then(function (result) {
84 | ok(MyShinyPromise.calls > 0, "at least 1 call of the new Promise");
85 | JSZip.external.Promise = OriginalPromise;
86 | done();
87 | })['catch'](JSZipTestUtils.assertNoError);
88 |
89 | assert.ok(promise.isACustomImplementation, "the custom implementation is used");
90 | });
91 |
92 | JSZipTestUtils.testZipFile("external.Promise can be replaced in .loadAsync()", "ref/all.zip", function (all) {
93 | stop();
94 | var OriginalPromise = JSZip.external.Promise;
95 | var MyShinyPromise = createPromiseProxy(OriginalPromise);
96 |
97 | JSZip.external.Promise = MyShinyPromise;
98 |
99 | var promise = JSZip.loadAsync(all).then(function (result) {
100 | ok(MyShinyPromise.calls > 0, "at least 1 call of the new Promise");
101 | JSZip.external.Promise = OriginalPromise;
102 | start();
103 | })['catch'](JSZipTestUtils.assertNoError);
104 |
105 | ok(promise.isACustomImplementation, "the custom implementation is used");
106 | });
107 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/filter.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("filter");
6 |
7 | test("Filtering a zip", function() {
8 | var zip = new JSZip();
9 | zip.file("1.txt", "1\n");
10 | zip.file("2.txt", "2\n");
11 | zip.file("3.log", "3\n");
12 | var result = zip.filter(function (relativeFilename, file){
13 | return relativeFilename.indexOf(".txt") !== -1;
14 | });
15 | equal(result.length, 2, "filter has filtered");
16 | ok(result[0].name.indexOf(".txt") !== -1, "filter has filtered the good file");
17 | ok(result[1].name.indexOf(".txt") !== -1, "filter has filtered the good file");
18 | });
19 |
20 | test("Filtering a zip from a relative path", function() {
21 | var zip = new JSZip();
22 | zip.file("foo/1.txt", "1\n");
23 | zip.file("foo/2.txt", "2\n");
24 | zip.file("foo/3.log", "3\n");
25 | zip.file("1.txt", "1\n");
26 | zip.file("2.txt", "2\n");
27 | zip.file("3.log", "3\n");
28 |
29 | var count = 0;
30 | var result = zip.folder("foo").filter(function (relativeFilename, file) {
31 | count++;
32 | return relativeFilename.indexOf("3") !== -1;
33 | });
34 | equal(count, 3, "the callback has been called the right number of times");
35 | equal(result.length, 1, "filter has filtered");
36 | equal(result[0].name, "foo/3.log", "filter has filtered the good file");
37 | });
38 |
39 | test("Filtering a zip : the full path is still accessible", function() {
40 | var zip = new JSZip();
41 | zip.file("foo/1.txt", "1\n");
42 | zip.file("foo/2.txt", "2\n");
43 | zip.file("foo/3.log", "3\n");
44 | zip.file("1.txt", "1\n");
45 | zip.file("2.txt", "2\n");
46 | zip.file("3.log", "3\n");
47 |
48 | var result = zip.folder("foo").filter(function (relativeFilename, file) {
49 | return file.name.indexOf("3") !== -1;
50 | });
51 | equal(result.length, 1, "the filter only match files/folders in the current folder");
52 | equal(result[0].name, "foo/3.log", "filter has filtered the good file");
53 | });
54 |
55 |
56 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/foreach.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("forEach");
6 |
7 | test("forEach works on /", function (assert) {
8 | var zip = JSZipTestUtils.createZipAll();
9 | var count = 0;
10 | var calls = [];
11 |
12 | assert.equal(zip.root, "");
13 |
14 | zip.forEach(function (path, elt) {
15 | assert.equal(path, elt.name, "the full path is given on / for " + elt.name);
16 | count++;
17 | calls.push(path);
18 | });
19 |
20 | equal(count, 3, "the callback has been called the right number of times");
21 | assert.deepEqual(calls, ["Hello.txt", "images/", "images/smile.gif"], "all paths have been called");
22 | });
23 |
24 | test("forEach works on a sub folder", function (assert) {
25 | var zip = new JSZip();
26 | var sub = zip.folder("subfolder");
27 | sub.file("Hello.txt", "Hello World\n");
28 | sub.folder("images").file("smile.gif", "R0lGODdhBQAFAIACAAAAAP/eACwAAAAABQAFAAACCIwPkWerClIBADs=", {base64: true});
29 | var count = 0;
30 | var calls = [];
31 |
32 | assert.ok(zip.file("subfolder/Hello.txt"));
33 | assert.equal(sub.root, "subfolder/");
34 |
35 | sub.forEach(function (path, elt) {
36 | assert.equal(path, elt.name.substr("subfolder/".length), "the full path is given on subfolder/ for " + path);
37 | count++;
38 | calls.push(path);
39 | });
40 |
41 | equal(count, 3, "the callback has been called the right number of times");
42 | assert.deepEqual(calls, ["Hello.txt", "images/", "images/smile.gif"], "all paths have been called");
43 | });
44 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/asserts/version.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | QUnit.module("version");
6 |
7 | test("JSZip.version is correct", function(assert){
8 | assert.ok(JSZip.version, "JSZip.version exists");
9 | assert.ok(JSZip.version.match(/^\d+\.\d+\.\d+/), "JSZip.version looks like a correct version");
10 | });
11 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/helpers/browser-test-utils.js:
--------------------------------------------------------------------------------
1 | /* global JSZip,JSZipUtils,JSZipTestUtils */
2 | 'use strict';
3 | JSZipTestUtils.loadZipFile = function (name, callback) {
4 | JSZipUtils.getBinaryContent(name + "?_=" + ( new Date() ).getTime(), callback);
5 | };
6 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/helpers/node-test-utils.js:
--------------------------------------------------------------------------------
1 | /* jshint qunit: true */
2 | /* global JSZip,JSZipTestUtils */
3 | 'use strict';
4 |
5 | var fs = require("fs");
6 | var path = require("path");
7 |
8 | global.JSZip = require("../../lib/index");
9 |
10 | global.JSZipTestUtils.loadZipFile = function(name, callback) {
11 | fs.readFile(path.join("test", name), "binary", callback);
12 | };
13 | process.on('uncaughtException', function(err) {
14 | console.log('uncaughtException: ' + err, err.stack);
15 | process.exit(1);
16 | });
17 |
18 | process.on('unhandledRejection', function(err) {
19 | console.log('unhandledRejection: ' + err, err.stack);
20 | process.exit(1);
21 | });
22 |
23 |
24 |
25 | // Deprecated
26 | // Extend assert methods to QUnit and Global scope through Backwards compatibility
27 | (function() {
28 | function Assert( testContext ) {
29 | this.test = testContext;
30 | }
31 | Assert.prototype = QUnit.assert;
32 | var i,
33 | assertions = QUnit.assert;
34 |
35 | function applyCurrent( current ) {
36 | return function() {
37 | var assert = new Assert( QUnit.config.current );
38 | current.apply( assert, arguments );
39 | };
40 | }
41 |
42 | for ( i in assertions ) {
43 | if (!assertions.hasOwnProperty(i)) {
44 | continue;
45 | }
46 | QUnit[ i ] = applyCurrent( assertions[ i ] );
47 | global[ i ] = QUnit[ i ];
48 | }
49 | })();
50 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSZip Testing
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
57 |
58 |
59 |
62 |
65 |
66 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all-stream.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all-stream.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.7zip.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.7zip.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.windows.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.windows.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_appended_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_appended_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_missing_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_missing_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_prepended_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/all_prepended_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/archive_comment.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/archive_comment.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/backslash.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/backslash.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/AntarcticaTemps.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/AntarcticaTemps.ods
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/AntarcticaTemps.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/AntarcticaTemps.xlsx
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/Franz Kafka - The Metamorphosis.epub:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/Franz Kafka - The Metamorphosis.epub
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/Outlook2007_Calendar.xps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/complex_files/Outlook2007_Calendar.xps
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/data_descriptor.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/data_descriptor.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/deflate-stream.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/deflate-stream.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/deflate.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/deflate.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/empty.zip:
--------------------------------------------------------------------------------
1 | PK
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/encrypted.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/encrypted.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/extra_attributes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/extra_attributes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/folder.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/folder.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/image.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/image.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/bad_decompressed_size.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/bad_decompressed_size.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/bad_offset.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/bad_offset.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/compression.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/compression.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/crc32.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/invalid/crc32.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/local_encoding_in_name.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/local_encoding_in_name.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested_data_descriptor.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested_data_descriptor.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested_zip64.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/nested_zip64.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_7z.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_7z.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_ark.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_ark.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_file_roller-ubuntu.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_file_roller-ubuntu.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_file_roller-xubuntu.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_file_roller-xubuntu.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_zip.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/linux_zip.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/mac_finder.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/mac_finder.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_7z.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_7z.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_compressed_folders.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_compressed_folders.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_izarc.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_izarc.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_winrar.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/permissions/windows_winrar.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/pile_of_poo.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/pile_of_poo.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/slashes_and_izarc.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/slashes_and_izarc.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/store-stream.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/store-stream.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/store.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/store.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/subfolder.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/subfolder.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/text.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/text.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/utf8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/utf8.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/utf8_in_name.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/utf8_in_name.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/winrar_utf8_in_name.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/winrar_utf8_in_name.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_appended_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_appended_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_missing_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_missing_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_prepended_bytes.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/ref/zip64_prepended_bytes.zip
--------------------------------------------------------------------------------
/web/crx/lib/Stuk-jszip-9fb481a/test/smile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/lib/Stuk-jszip-9fb481a/test/smile.gif
--------------------------------------------------------------------------------
/web/crx/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Scratcher's AtCoder",
3 | "short_name": "ScratchersAC",
4 | "description" : "for Scratchers who want to compete in AtCoder",
5 | "version": "1.4.0",
6 | "manifest_version": 2,
7 | "homepage_url": "https://github.com/yos1up/scratch2cpp/tree/master/web/crx",
8 | "icons": {
9 | "16": "icon16.png",
10 | "48": "icon48.png",
11 | "128": "icon128.png"
12 | },
13 | "browser_action": {
14 | "default_popup": "popup.html",
15 | "default_icon": "icon.png"
16 | },
17 | "content_scripts": [
18 | {
19 | "matches": ["https://atcoder.jp/contests/*/submit*", "https://atcoder.jp/contests/*/tasks/*", "https://atcoder.jp/contests/*/custom_test*"],
20 | "js": ["lib/jquery-3.3.1.min.js", "lib/Stuk-jszip-9fb481a/dist/jszip.js", "lib/Stuk-jszip-9fb481a/dist/jszip.min.js", "sb2_to_cpp.js", "sb3_to_cpp.js", "main.js"]
21 | }
22 | ]
23 | }
--------------------------------------------------------------------------------
/web/crx/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Scratcher's AtCoder
4 | https://github.com/yos1up/scratch2cpp/web/crx/
5 |
6 |
7 |
--------------------------------------------------------------------------------
/web/crx/scrshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/scrshot.png
--------------------------------------------------------------------------------
/web/crx/scrshot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/scrshot2.png
--------------------------------------------------------------------------------
/web/crx/scrshot3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/scrshot3.png
--------------------------------------------------------------------------------
/web/crx/scrshot4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yos1up/scratch2cpp/e2fdc8b3f0b28656c7f709ab09abd4571921861b/web/crx/scrshot4.png
--------------------------------------------------------------------------------