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 +8 -2
- package/build.sh +6 -3
- package/deno.json +1 -1
- package/lib/bidi-client.js +1221 -0
- package/lib/bidi.js +141 -0
- package/lib/browser.js +14 -209
- package/lib/cdp-client.js +11 -11
- package/lib/chromium.js +225 -0
- package/lib/constants.js +27 -4
- package/lib/deno-polyfill.js +5 -0
- package/lib/firefox.js +182 -0
- package/lib/single-file-archive.js +5 -5
- package/lib/single-file-bundle.js +1 -1
- package/lib/version.js +1 -1
- package/options.js +20 -2
- package/package.json +2 -1
- package/single-file-cli-api.js +11 -5
- package/single-file-launcher.js +3 -3
- package/test/e2e/automation-detection.test.js +4 -3
- package/test/e2e/fidelity.test.js +2 -2
- package/test/e2e/html-at-media-url.test.js +96 -0
- package/test/e2e/password.test.js +47 -0
- package/test/e2e/proxy-auth.test.js +53 -0
- package/test/e2e/service-worker.test.js +2 -2
- package/test/fidelity/browser.js +3 -3
- package/test/target.js +5 -1
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.
|
|
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
|
-
|
|
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');
|