single-file-core 1.6.33 → 1.6.35

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/core/helper.js CHANGED
@@ -802,7 +802,6 @@ function getElementsInfo(win, doc, element, options, data = { usedFonts: new Map
802
802
  if (options.removeUnusedFonts && doc.defaultView && !headChild) {
803
803
  const elementCharacters = getElementCharacters(win, element);
804
804
  getUsedFont(computedStyle, data.usedFonts, data.usedFontsCharacters, elementCharacters);
805
- getUsedFont(getComputedStyle(win, element, ":first-letter"), data.usedFonts, data.usedFontsCharacters, elementCharacters);
806
805
  const beforeStyle = getComputedStyle(win, element, ":before");
807
806
  getUsedFont(beforeStyle, data.usedFonts, data.usedFontsCharacters, getPseudoElementCharacters(beforeStyle));
808
807
  const afterStyle = getComputedStyle(win, element, ":after");
@@ -813,6 +812,7 @@ function getElementsInfo(win, doc, element, options, data = { usedFonts: new Map
813
812
  getUsedFont(getComputedStyle(win, element, "::marker"), data.usedFonts);
814
813
  }
815
814
  if (BLOCK_CONTAINER_DISPLAY_VALUES.includes(display)) {
815
+ getUsedFont(getComputedStyle(win, element, ":first-letter"), data.usedFonts, data.usedFontsCharacters, elementCharacters);
816
816
  getUsedFont(getComputedStyle(win, element, "::first-line"), data.usedFonts, data.usedFontsCharacters, elementCharacters);
817
817
  }
818
818
  if ((tagName == "INPUT" || tagName == "TEXTAREA") && element.getAttribute("placeholder")) {
package/core/index.js CHANGED
@@ -1323,7 +1323,8 @@ class Processor {
1323
1323
  const blankPosterURI = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" +
1324
1324
  (videoData.size.videoWidth || videoData.size.pxWidth) + "' height='" +
1325
1325
  (videoData.size.videoHeight || videoData.size.pxHeight) + "'%3E%3C/svg%3E";
1326
- if (!this.options.doc) {
1326
+ const liveDoc = this.options.doc || (this.options.win && this.options.win.document);
1327
+ if (!liveDoc) {
1327
1328
  videoElement.poster = this.registerGeneratedDataURI(blankPosterURI);
1328
1329
  return;
1329
1330
  }
@@ -1335,7 +1336,7 @@ class Processor {
1335
1336
  temporaryVideoElement.crossOrigin = "anonymous";
1336
1337
  const canvasElement = this.doc.createElement("canvas");
1337
1338
  const context = canvasElement.getContext("2d");
1338
- this.options.doc.body.appendChild(temporaryVideoElement);
1339
+ liveDoc.body.appendChild(temporaryVideoElement);
1339
1340
  return new Promise(resolve => {
1340
1341
  temporaryVideoElement.currentTime = videoData.currentTime;
1341
1342
  temporaryVideoElement.oncanplay = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.6.33",
3
+ "version": "1.6.35",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -71,7 +71,7 @@ const FRAME_OPTION_NAMES = [
71
71
  "loadDeferredContentBlockStorage"
72
72
  ];
73
73
  const TARGET_ORIGIN = "*";
74
- const TIMEOUT_INIT_REQUEST_MESSAGE = 5000;
74
+ const TIMEOUT_INIT_REQUEST_MESSAGE = 2000;
75
75
  const TIMEOUT_INIT_RESPONSE_MESSAGE = 10000;
76
76
  const TOP_WINDOW_ID = "0";
77
77
  const WINDOW_ID_SEPARATOR = ".";