single-file-core 1.0.1 → 1.0.4
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 -3
- package/index.js +1 -1
- package/modules/css-fonts-alt-minifier.js +1 -1
- package/modules/css-fonts-minifier.js +1 -1
- package/modules/css-matched-rules.js +1 -1
- package/modules/css-medias-alt-minifier.js +1 -1
- package/modules/css-rules-minifier.js +1 -1
- package/modules/html-images-alt-minifier.js +1 -1
- package/modules/html-minifier.js +1 -1
- package/modules/html-serializer.js +1 -1
- package/modules/index.js +2 -2
- package/package.json +1 -1
- package/processors/frame-tree/content/content-frame-tree.js +1 -1
- package/processors/hooks/content/content-hooks-frames-web.js +1 -1
- package/processors/hooks/content/content-hooks-frames.js +19 -19
- package/processors/hooks/content/content-hooks-web.js +1 -1
- package/processors/hooks/content/content-hooks.js +2 -2
- package/processors/index.js +1 -1
- package/processors/lazy/content/content-lazy-loader.js +2 -2
- package/single-file-bootstrap.js +23 -0
- package/single-file-core.js +1 -1
- package/single-file-frames.js +23 -0
- package/single-file-helper.js +2 -2
- package/single-file-util.js +1 -1
- package/vendor/index.js +3 -3
package/.eslintrc.js
CHANGED
package/index.js
CHANGED
package/modules/html-minifier.js
CHANGED
package/modules/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import * as fontsAltMinifier from "./css-fonts-alt-minifier.js";
|
|
25
|
-
import * as fontsMinifier from "./css-fonts-minifier";
|
|
25
|
+
import * as fontsMinifier from "./css-fonts-minifier.js";
|
|
26
26
|
import * as matchedRules from "./css-matched-rules.js";
|
|
27
27
|
import * as mediasAltMinifier from "./css-medias-alt-minifier.js";
|
|
28
28
|
import * as cssRulesMinifier from "./css-rules-minifier.js";
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -56,26 +56,26 @@ if (window._singleFile_fontFaces) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
if (document instanceof Document) {
|
|
59
|
+
addEventListener(NEW_FONT_FACE_EVENT, event => {
|
|
60
|
+
const detail = event.detail;
|
|
61
|
+
const key = Object.assign({}, detail);
|
|
62
|
+
delete key.src;
|
|
63
|
+
fontFaces.set(JSON.stringify(key), detail);
|
|
64
|
+
});
|
|
65
|
+
addEventListener(DELETE_FONT_EVENT, event => {
|
|
66
|
+
const detail = event.detail;
|
|
67
|
+
const key = Object.assign({}, detail);
|
|
68
|
+
delete key.src;
|
|
69
|
+
fontFaces.delete(JSON.stringify(key));
|
|
70
|
+
});
|
|
71
|
+
addEventListener(CLEAR_FONTS_EVENT, () => fontFaces = new Map());
|
|
72
|
+
let scriptElement = document.createElement("script");
|
|
73
|
+
scriptElement.src = "data:," + "(" + injectedScript.toString() + ")()";
|
|
74
|
+
(document.documentElement || document).appendChild(scriptElement);
|
|
75
|
+
scriptElement.remove();
|
|
59
76
|
if (browser && browser.runtime && browser.runtime.getURL) {
|
|
60
|
-
addEventListener(NEW_FONT_FACE_EVENT, event => {
|
|
61
|
-
const detail = event.detail;
|
|
62
|
-
const key = Object.assign({}, detail);
|
|
63
|
-
delete key.src;
|
|
64
|
-
fontFaces.set(JSON.stringify(key), detail);
|
|
65
|
-
});
|
|
66
|
-
addEventListener(DELETE_FONT_EVENT, event => {
|
|
67
|
-
const detail = event.detail;
|
|
68
|
-
const key = Object.assign({}, detail);
|
|
69
|
-
delete key.src;
|
|
70
|
-
fontFaces.delete(JSON.stringify(key));
|
|
71
|
-
});
|
|
72
|
-
addEventListener(CLEAR_FONTS_EVENT, () => fontFaces = new Map());
|
|
73
|
-
let scriptElement = document.createElement("script");
|
|
74
|
-
scriptElement.src = "data:," + "(" + injectedScript.toString() + ")()";
|
|
75
|
-
(document.documentElement || document).appendChild(scriptElement);
|
|
76
|
-
scriptElement.remove();
|
|
77
77
|
scriptElement = document.createElement("script");
|
|
78
|
-
scriptElement.src = browser.runtime.getURL("/lib/
|
|
78
|
+
scriptElement.src = browser.runtime.getURL("/lib/single-file-hooks-frames.js");
|
|
79
79
|
scriptElement.async = false;
|
|
80
80
|
(document.documentElement || document).appendChild(scriptElement);
|
|
81
81
|
scriptElement.remove();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -31,7 +31,7 @@ if (document instanceof Document) {
|
|
|
31
31
|
const scriptElement = document.createElement("script");
|
|
32
32
|
scriptElement.async = false;
|
|
33
33
|
if (browser && browser.runtime && browser.runtime.getURL) {
|
|
34
|
-
scriptElement.src = browser.runtime.getURL("/lib/
|
|
34
|
+
scriptElement.src = browser.runtime.getURL("/lib/single-file-hooks.js");
|
|
35
35
|
scriptElement.async = false;
|
|
36
36
|
}
|
|
37
37
|
(document.documentElement || document).appendChild(scriptElement);
|
package/processors/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
/* global globalThis */
|
|
25
25
|
|
|
26
|
-
import * as hooksFrames from "./../../hooks/content/content-hooks-frames";
|
|
26
|
+
import * as hooksFrames from "./../../hooks/content/content-hooks-frames.js";
|
|
27
27
|
import {
|
|
28
28
|
LAZY_SRC_ATTRIBUTE_NAME,
|
|
29
29
|
SINGLE_FILE_UI_ELEMENT_CLASS
|
package/single-file-bootstrap.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
|
+
* contact : gildas.lormeau <at> gmail.com
|
|
4
|
+
*
|
|
5
|
+
* This file is part of SingleFile.
|
|
6
|
+
*
|
|
7
|
+
* The code in this file is free software: you can redistribute it and/or
|
|
8
|
+
* modify it under the terms of the GNU Affero General Public License
|
|
9
|
+
* (GNU AGPL) as published by the Free Software Foundation, either version 3
|
|
10
|
+
* of the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* The code in this file is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
|
|
15
|
+
* General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* As additional permission under GNU AGPL version 3 section 7, you may
|
|
18
|
+
* distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU
|
|
19
|
+
* AGPL normally required by section 4, provided you include this license
|
|
20
|
+
* notice and a URL through which recipients can access the Corresponding
|
|
21
|
+
* Source.
|
|
22
|
+
*/
|
|
23
|
+
|
|
1
24
|
import * as frameTree from "./processors/frame-tree/content/content-frame-tree.js";
|
|
2
25
|
import * as serializer from "./modules/html-serializer.js";
|
|
3
26
|
import {
|
package/single-file-core.js
CHANGED
package/single-file-frames.js
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
|
+
* contact : gildas.lormeau <at> gmail.com
|
|
4
|
+
*
|
|
5
|
+
* This file is part of SingleFile.
|
|
6
|
+
*
|
|
7
|
+
* The code in this file is free software: you can redistribute it and/or
|
|
8
|
+
* modify it under the terms of the GNU Affero General Public License
|
|
9
|
+
* (GNU AGPL) as published by the Free Software Foundation, either version 3
|
|
10
|
+
* of the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* The code in this file is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
|
|
15
|
+
* General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* As additional permission under GNU AGPL version 3 section 7, you may
|
|
18
|
+
* distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU
|
|
19
|
+
* AGPL normally required by section 4, provided you include this license
|
|
20
|
+
* notice and a URL through which recipients can access the Corresponding
|
|
21
|
+
* Source.
|
|
22
|
+
*/
|
|
23
|
+
|
|
1
24
|
import "./processors/frame-tree/content/content-frame-tree.js";
|
package/single-file-helper.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/* global globalThis, CustomEvent */
|
|
25
25
|
|
|
26
26
|
import * as cssUnescape from "./vendor/css-unescape.js";
|
|
27
|
-
import * as hooksFrames from "./processors/hooks/content/content-hooks-frames";
|
|
27
|
+
import * as hooksFrames from "./processors/hooks/content/content-hooks-frames.js";
|
|
28
28
|
|
|
29
29
|
const ON_BEFORE_CAPTURE_EVENT_NAME = "single-file-on-before-capture";
|
|
30
30
|
const ON_AFTER_CAPTURE_EVENT_NAME = "single-file-on-after-capture";
|
package/single-file-util.js
CHANGED
package/vendor/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2022 Gildas Lormeau
|
|
3
3
|
* contact : gildas.lormeau <at> gmail.com
|
|
4
4
|
*
|
|
5
5
|
* This file is part of SingleFile.
|
|
@@ -26,8 +26,8 @@ import * as mediaQueryParser from "./css-media-query-parser.js";
|
|
|
26
26
|
import * as cssMinifier from "./css-minifier.js";
|
|
27
27
|
import * as cssTree from "./css-tree.js";
|
|
28
28
|
import * as cssUnescape from "./css-unescape.js";
|
|
29
|
-
import * as srcsetParser from "./html-srcset-parser";
|
|
30
|
-
import { MIMEType } from "./mime-type-parser";
|
|
29
|
+
import * as srcsetParser from "./html-srcset-parser.js";
|
|
30
|
+
import { MIMEType } from "./mime-type-parser.js";
|
|
31
31
|
|
|
32
32
|
export {
|
|
33
33
|
fontPropertyParser,
|