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.
@@ -35,6 +35,7 @@ const helper = {
35
35
  };
36
36
 
37
37
  const FontFace = globalThis.FontFace;
38
+ const JSON = globalThis.JSON;
38
39
 
39
40
  const REGEXP_URL_SIMPLE_QUOTES_FN = /url\s*\(\s*'(.*?)'\s*\)/i;
40
41
  const REGEXP_URL_DOUBLE_QUOTES_FN = /url\s*\(\s*"(.*?)"\s*\)/i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -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) {
@@ -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
  }
@@ -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;