single-file-cli 2.0.33 → 2.0.34

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/Dockerfile CHANGED
@@ -6,7 +6,7 @@ WORKDIR /usr/src/app/node_modules/single-file-cli
6
6
 
7
7
  ENTRYPOINT [ \
8
8
  "node", \
9
- "./single-file", \
9
+ "./single-file-node.js", \
10
10
  "--browser-executable-path", "/usr/bin/chromium-browser", \
11
11
  "--output-directory", "./../../out/", \
12
12
  "--dump-content" ]
package/build.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/bin/sh
2
2
 
3
- deno vendor "npm:single-file-core@1.3.28"
3
+ deno vendor "npm:single-file-core@1.3.30"
4
4
 
5
5
  echo "
6
6
  import { build } from 'npm:esbuild';
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@single-file/single-file-cli",
3
- "version": "2.0.33",
3
+ "version": "2.0.34",
4
4
  "description": "SingleFile CLI",
5
5
  "nodeModulesDir": true,
6
6
  "exports": {
package/lib/browser.js CHANGED
@@ -64,7 +64,10 @@ async function launchBrowser(options = {}, indexPath = 0) {
64
64
  args = args.filter(arg => !argNames.includes(arg.split("=")[0]));
65
65
  args.push(...options.args);
66
66
  }
67
- if (args.includes("--headless=new") || args.includes("--auto-open-devtools-for-tabs")) {
67
+ if (args.includes("--headless=new") ||
68
+ args.includes("--auto-open-devtools-for-tabs") ||
69
+ args.includes("--start-maximized") ||
70
+ !args.includes("--headless")) {
68
71
  args.push("--disable-site-isolation-trials");
69
72
  }
70
73
  const command = new Command(executablePath, { args, stdout: PIPED_STD_CONFIG, stderr: PIPED_STD_CONFIG });
package/lib/cdp-client.js CHANGED
@@ -105,6 +105,11 @@ async function getPageData(options) {
105
105
  if (options.browserWaitDelay) {
106
106
  setTimeout(() => resolve, options.browserWaitDelay);
107
107
  }
108
+ if (options.embedScreenshot && options.compressContent) {
109
+ const { data } = await Page.captureScreenshot({ format: "png", captureBeyondViewport: true });
110
+ const dataURI = "data:image/png;base64," + data;
111
+ options.embeddedImage = Array.from(new Uint8Array(await (await fetch(dataURI)).arrayBuffer()));
112
+ }
108
113
  const { result } = await Runtime.evaluate({
109
114
  expression: `singlefile.getPageData(${JSON.stringify(options)})`,
110
115
  awaitPromise: true,