single-file-core 1.3.19 → 1.3.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -27,21 +27,10 @@ export {
27
27
  display
28
28
  };
29
29
 
30
- async function display(document, docContent, { disableFramePointerEvents, insertEmbeddedImage }) {
30
+ async function display(document, docContent, { disableFramePointerEvents }) {
31
31
  docContent = docContent.replace(/<noscript/gi, "<template disabled-noscript");
32
32
  docContent = docContent.replaceAll(/<\/noscript/gi, "</template");
33
33
  const doc = (new DOMParser()).parseFromString(docContent, "text/html");
34
- if (!insertEmbeddedImage) {
35
- if (doc.doctype) {
36
- if (document.doctype) {
37
- document.replaceChild(doc.doctype, document.doctype);
38
- } else {
39
- document.insertBefore(doc.doctype, document.documentElement);
40
- }
41
- } else if (document.doctype) {
42
- document.doctype.remove();
43
- }
44
- }
45
34
  if (disableFramePointerEvents) {
46
35
  doc.querySelectorAll("iframe").forEach(element => {
47
36
  const pointerEvents = "pointer-events";
@@ -49,14 +38,10 @@ async function display(document, docContent, { disableFramePointerEvents, insert
49
38
  element.style.setProperty(pointerEvents, "none", "important");
50
39
  });
51
40
  }
52
- if (insertEmbeddedImage) {
53
- document.open();
54
- document.write(getDoctypeString(doc));
55
- document.write(doc.documentElement.outerHTML);
56
- document.close();
57
- } else {
58
- document.replaceChild(document.importNode(doc.documentElement, true), document.documentElement);
59
- }
41
+ document.open();
42
+ document.write(getDoctypeString(doc));
43
+ document.write(doc.documentElement.outerHTML);
44
+ document.close();
60
45
  document.querySelectorAll("template[disabled-noscript]").forEach(element => {
61
46
  const noscriptElement = document.createElement("noscript");
62
47
  element.removeAttribute("disabled-noscript");