single-file-core 1.0.41 → 1.0.43
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/modules/css-fonts-alt-minifier.js +1 -0
- package/package.json +1 -1
- package/processors/frame-tree/content/content-frame-tree.js +1 -0
- package/processors/hooks/content/content-hooks-frames-web.js +1 -0
- package/processors/hooks/content/content-hooks-frames.js +1 -0
- package/single-file-core.js +2 -1
- package/single-file-helper.js +2 -1
package/package.json
CHANGED
|
@@ -63,6 +63,7 @@ const addEventListener = (type, listener, options) => globalThis.addEventListene
|
|
|
63
63
|
const top = globalThis.top;
|
|
64
64
|
const MessageChannel = globalThis.MessageChannel;
|
|
65
65
|
const document = globalThis.document;
|
|
66
|
+
const JSON = globalThis.JSON;
|
|
66
67
|
|
|
67
68
|
let sessions = globalThis.sessions;
|
|
68
69
|
if (!sessions) {
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
const FileReader = globalThis.FileReader;
|
|
69
69
|
const Blob = globalThis.Blob;
|
|
70
70
|
const console = globalThis.console;
|
|
71
|
+
const JSON = globalThis.JSON;
|
|
71
72
|
const warn = (console && console.warn && ((...args) => console.warn(...args))) || (() => { });
|
|
72
73
|
|
|
73
74
|
const observers = new Map();
|
|
@@ -46,6 +46,7 @@ const dispatchEvent = event => { try { globalThis.dispatchEvent(event); } catch
|
|
|
46
46
|
const CustomEvent = globalThis.CustomEvent;
|
|
47
47
|
const document = globalThis.document;
|
|
48
48
|
const Document = globalThis.Document;
|
|
49
|
+
const JSON = globalThis.JSON;
|
|
49
50
|
|
|
50
51
|
let fontFaces;
|
|
51
52
|
if (window._singleFile_fontFaces) {
|
package/single-file-core.js
CHANGED
|
@@ -27,6 +27,7 @@ const DEBUG = false;
|
|
|
27
27
|
|
|
28
28
|
const Set = globalThis.Set;
|
|
29
29
|
const Map = globalThis.Map;
|
|
30
|
+
const JSON = globalThis.JSON;
|
|
30
31
|
|
|
31
32
|
let util, cssTree;
|
|
32
33
|
|
|
@@ -674,7 +675,7 @@ class Processor {
|
|
|
674
675
|
const attributeValue = element.getAttribute(util.POSTER_ATTRIBUTE_NAME);
|
|
675
676
|
if (attributeValue) {
|
|
676
677
|
const posterURL = this.options.posters[Number(attributeValue)];
|
|
677
|
-
if (!videoElement.poster && posterURL) {
|
|
678
|
+
if (!videoElement.getAttribute("poster") && posterURL) {
|
|
678
679
|
videoElement.setAttribute("poster", posterURL);
|
|
679
680
|
}
|
|
680
681
|
}
|
package/single-file-helper.js
CHANGED
|
@@ -64,6 +64,7 @@ const SINGLE_FILE_UI_ELEMENT_CLASS = "single-file-ui-element";
|
|
|
64
64
|
const EMPTY_RESOURCE = "data:,";
|
|
65
65
|
const addEventListener = (type, listener, options) => globalThis.addEventListener(type, listener, options);
|
|
66
66
|
const dispatchEvent = event => { try { globalThis.dispatchEvent(event); } catch (error) { /* ignored */ } };
|
|
67
|
+
const JSON = globalThis.JSON;
|
|
67
68
|
|
|
68
69
|
export {
|
|
69
70
|
initUserScriptHandler,
|
|
@@ -300,7 +301,7 @@ function getResourcesInfo(win, doc, element, options, data, elementHidden, compu
|
|
|
300
301
|
});
|
|
301
302
|
element.setAttribute(VIDEO_ATTRIBUTE_NAME, data.videos.length - 1);
|
|
302
303
|
}
|
|
303
|
-
if (!element.poster) {
|
|
304
|
+
if (!element.getAttribute("poster")) {
|
|
304
305
|
const canvasElement = doc.createElement("canvas");
|
|
305
306
|
const context = canvasElement.getContext("2d");
|
|
306
307
|
canvasElement.width = element.clientWidth;
|