single-file-core 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +0 -0
- package/LICENSE +0 -0
- package/common/content-infobar-web.js +0 -1
- package/modules/css-fonts-alt-minifier.js +0 -0
- package/modules/css-fonts-minifier.js +0 -0
- package/modules/css-matched-rules.js +0 -0
- package/modules/css-medias-alt-minifier.js +0 -0
- package/modules/css-rules-minifier.js +0 -0
- package/modules/html-images-alt-minifier.js +0 -0
- package/modules/html-minifier.js +0 -0
- package/modules/html-serializer.js +0 -0
- package/modules/index.js +0 -0
- package/package.json +1 -1
- package/processors/frame-tree/content/content-frame-tree.js +0 -0
- package/processors/hooks/content/content-hooks-frames-web.js +17 -0
- package/processors/hooks/content/content-hooks-frames.js +0 -0
- package/processors/index.js +0 -0
- package/processors/lazy/content/content-lazy-loader.js +0 -0
- package/single-file-bootstrap.js +0 -0
- package/single-file-core.js +0 -0
- package/single-file-frames.js +0 -0
- package/single-file-helper.js +0 -0
- package/single-file-hooks-frames.js +0 -0
- package/single-file-infobar.js +0 -0
- package/single-file-util.js +0 -0
- package/single-file.js +0 -0
- package/vendor/css-font-property-parser.js +0 -0
- package/vendor/css-media-query-parser.js +0 -0
- package/vendor/css-minifier.js +0 -0
- package/vendor/css-tree.js +0 -0
- package/vendor/css-unescape.js +0 -0
- package/vendor/html-srcset-parser.js +0 -0
- package/vendor/index.js +0 -0
- package/vendor/mime-type-parser.js +0 -0
package/.eslintrc.js
CHANGED
|
File without changes
|
package/LICENSE
CHANGED
|
File without changes
|
|
@@ -170,7 +170,6 @@
|
|
|
170
170
|
async function initInfobar(url, saveDate, infoData) {
|
|
171
171
|
let infobarElement = document.querySelector(INFOBAR_TAGNAME);
|
|
172
172
|
if (!infobarElement) {
|
|
173
|
-
url = url.split("url: ")[1];
|
|
174
173
|
saveDate = saveDate.split("saved date: ")[1];
|
|
175
174
|
if (infoData && infoData.length > 1) {
|
|
176
175
|
let content = infoData[0].split("info: ")[1].trim();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/modules/html-minifier.js
CHANGED
|
File without changes
|
|
File without changes
|
package/modules/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
const LAZY_LOAD_ATTRIBUTE = "single-file-lazy-load";
|
|
41
41
|
const LOAD_IMAGE_EVENT = "single-file-load-image";
|
|
42
42
|
const IMAGE_LOADED_EVENT = "single-file-image-loaded";
|
|
43
|
+
const FETCH_REQUEST_EVENT = "single-file-request-fetch";
|
|
44
|
+
const FETCH_ACK_EVENT = "single-file-ack-fetch";
|
|
45
|
+
const FETCH_RESPONSE_EVENT = "single-file-response-fetch";
|
|
43
46
|
const NEW_FONT_FACE_EVENT = "single-file-new-font-face";
|
|
44
47
|
const DELETE_FONT_EVENT = "single-file-delete-font";
|
|
45
48
|
const CLEAR_FONTS_EVENT = "single-file-clear-fonts";
|
|
@@ -55,6 +58,7 @@
|
|
|
55
58
|
|
|
56
59
|
const addEventListener = (type, listener, options) => globalThis.addEventListener(type, listener, options);
|
|
57
60
|
const dispatchEvent = event => { try { globalThis.dispatchEvent(event); } catch (error) { /* ignored */ } };
|
|
61
|
+
const fetch = (url, options) => globalThis.fetch(url, options);
|
|
58
62
|
const CustomEvent = globalThis.CustomEvent;
|
|
59
63
|
const document = globalThis.document;
|
|
60
64
|
const screen = globalThis.screen;
|
|
@@ -293,6 +297,19 @@
|
|
|
293
297
|
}
|
|
294
298
|
});
|
|
295
299
|
|
|
300
|
+
addEventListener(FETCH_REQUEST_EVENT, async event => {
|
|
301
|
+
dispatchEvent(new CustomEvent(FETCH_ACK_EVENT));
|
|
302
|
+
const { url, options } = JSON.parse(event.detail);
|
|
303
|
+
let detail;
|
|
304
|
+
try {
|
|
305
|
+
const response = await fetch(url, options);
|
|
306
|
+
detail = { url, response: await response.arrayBuffer(), headers: [...response.headers], status: response.status };
|
|
307
|
+
} catch (error) {
|
|
308
|
+
detail = { url, error: error && error.toString() };
|
|
309
|
+
}
|
|
310
|
+
dispatchEvent(new CustomEvent(FETCH_RESPONSE_EVENT, { detail }));
|
|
311
|
+
});
|
|
312
|
+
|
|
296
313
|
if (globalThis.FontFace) {
|
|
297
314
|
const FontFace = globalThis.FontFace;
|
|
298
315
|
let warningFontFaceDisplayed;
|
|
File without changes
|
package/processors/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/single-file-bootstrap.js
CHANGED
|
File without changes
|
package/single-file-core.js
CHANGED
|
File without changes
|
package/single-file-frames.js
CHANGED
|
File without changes
|
package/single-file-helper.js
CHANGED
|
File without changes
|
|
File without changes
|
package/single-file-infobar.js
CHANGED
|
File without changes
|
package/single-file-util.js
CHANGED
|
File without changes
|
package/single-file.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/vendor/css-minifier.js
CHANGED
|
File without changes
|
package/vendor/css-tree.js
CHANGED
|
File without changes
|
package/vendor/css-unescape.js
CHANGED
|
File without changes
|
|
File without changes
|
package/vendor/index.js
CHANGED
|
File without changes
|
|
File without changes
|