single-file-core 1.0.42 → 1.0.44

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.42",
3
+ "version": "1.0.44",
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();
@@ -322,7 +323,7 @@
322
323
  getDetailObject(...arguments).then(detail => dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
323
324
  return new FontFace(...arguments);
324
325
  };
325
- globalThis.FontFace.toString = function () { return "function FontFace() { [native code] }"; };
326
+ globalThis.FontFace.prototype = FontFace.prototype;
326
327
  const deleteFont = document.fonts.delete;
327
328
  document.fonts.delete = function (fontFace) {
328
329
  getDetailObject(fontFace.family).then(detail => dispatchEvent(new CustomEvent(DELETE_FONT_EVENT, { detail })));
@@ -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
 
@@ -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,