single-file-core 1.5.105 → 1.5.106

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.5.105",
3
+ "version": "1.5.106",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -34,6 +34,8 @@ import {
34
34
  createArchive
35
35
  } from "./compression.js";
36
36
 
37
+ const browser = globalThis.browser;
38
+
37
39
  const PAGES_PREFIX = "pages/";
38
40
  const PAGES_FILENAME = "sfz-pages.json";
39
41
  const TOC_FILENAME = "sfz-toc.html";
@@ -49,7 +51,11 @@ const SYMLINK_UNIX_MODE = 0o120777;
49
51
  export { createPagesArchive };
50
52
 
51
53
  async function createPagesArchive(pages, options) {
52
- configure({ useWebWorkers: false });
54
+ if (browser && browser.runtime && browser.runtime.getURL) {
55
+ configure({ workerURI: "/lib/single-file-z-worker.js", workerStartupTimeout: 2000 });
56
+ } else {
57
+ configure({ useWebWorkers: false });
58
+ }
53
59
  const manifest = {
54
60
  pages: pages.map((page, pageIndex) => ({
55
61
  path: getPagePath(pageIndex),