single-file-cli 2.7.2 → 2.9.0

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/README.MD CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  [SingleFile](https://www.getsinglefile.com) can be launched from the command line by running it into a (headless) browser.
6
6
 
7
- It runs through Deno as a standalone script injected into the web page via the Chrome DevTools Protocol instead of being embedded into a WebExtension.
7
+ It runs through Deno as a standalone script injected into the web page via the Chrome DevTools Protocol, or via WebDriver BiDi when using Firefox, instead of being embedded into a WebExtension.
8
8
 
9
9
  ## Installation
10
10
 
11
11
  SingleFile can be run without installing it, just download the executable file and save it in the directory of your choice here: https://github.com/gildas-lormeau/single-file-cli/releases
12
12
 
13
- Make sure Chrome or a Chromium-based browser is installed in the default folder. Otherwise you might need to set the `--browser-executable-path` option to help SingleFile locating the path of the executable file.
13
+ Make sure Chrome or a Chromium-based browser is installed in the default folder. Otherwise you might need to set the `--browser-executable-path` option to help SingleFile locating the path of the executable file. Firefox can be used instead by setting the `--browser-engine firefox` option, with some limitations described in the help.
14
14
 
15
15
  ## Installation with Docker
16
16
 
@@ -133,6 +133,12 @@ Make sure Chrome or a Chromium-based browser is installed in the default folder.
133
133
  single-file https://www.example.com/account account.html --browser-profile=./profiles/example
134
134
  ```
135
135
 
136
+ - Save https://www.wikipedia.org with Firefox
137
+
138
+ ```sh
139
+ single-file https://www.wikipedia.org wikipedia.html --browser-engine firefox
140
+ ```
141
+
136
142
  - Save a list of URLs stored into `list-urls.txt` in the current folder
137
143
 
138
144
  ```sh
package/build.sh CHANGED
@@ -2,15 +2,16 @@
2
2
 
3
3
  set -e
4
4
 
5
- CORE_PACKAGE="npm:single-file-core@1.5.120"
5
+ CORE_PACKAGE="npm:single-file-core@1.5.121"
6
6
  ESBUILD_PACKAGE="npm:esbuild@0.27.7"
7
+ WEB_STREAMS_PACKAGE="npm:web-streams-polyfill@4.3.0"
7
8
 
8
9
  project_dir=$(pwd)
9
10
  build_dir=$(mktemp -d)
10
11
  trap 'rm -rf "$build_dir"' EXIT
11
12
 
12
13
  cd "$build_dir"
13
- deno install --vendor --quiet --minimum-dependency-age=0 "$CORE_PACKAGE"
14
+ deno install --vendor --quiet --minimum-dependency-age=0 "$CORE_PACKAGE" "$WEB_STREAMS_PACKAGE"
14
15
 
15
16
  echo "
16
17
  import { build } from '$ESBUILD_PACKAGE';
@@ -100,7 +101,9 @@ const hookScript = await Deno.readTextFile(lib + '/single-file-hooks-frames.js')
100
101
  script += 'const hookScript = ' + JSON.stringify(hookScript) + ';';
101
102
  const zipScript = await Deno.readTextFile(lib + '/zip.min.js');
102
103
  script += 'const zipScript = ' + JSON.stringify(zipScript) + ';';
103
- script += 'export { script, zipScript, hookScript };';
104
+ const webStreamsPonyfill = await Deno.readTextFile('$build_dir/node_modules/web-streams-polyfill/dist/ponyfill.js');
105
+ script += 'const webStreamsPonyfill = ' + JSON.stringify(webStreamsPonyfill) + ';';
106
+ script += 'export { script, zipScript, hookScript, webStreamsPonyfill };';
104
107
  await Deno.writeTextFile(lib + '/single-file-bundle.js', script)
105
108
  await Promise.all(SCRIPTS.map(script => Deno.remove(script)));
106
109
  await Deno.remove(lib + '/single-file-hooks-frames.js');
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@single-file/single-file-cli",
3
- "version": "2.7.2",
3
+ "version": "2.9.0",
4
4
  "description": "SingleFile CLI",
5
5
  "exports": {
6
6
  ".": "./single-file-cli-api.js"