single-file-cli 2.0.31 → 2.0.33

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
@@ -1,6 +1,6 @@
1
1
  FROM zenika/alpine-chrome:with-node
2
2
 
3
- RUN npm install --production single-file-cli
3
+ RUN npm install --omit=dev single-file-cli
4
4
 
5
5
  WORKDIR /usr/src/app/node_modules/single-file-cli
6
6
 
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@single-file/single-file-cli",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
4
4
  "description": "SingleFile CLI",
5
5
  "nodeModulesDir": true,
6
6
  "exports": {
package/lib/browser.js CHANGED
@@ -64,6 +64,9 @@ 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")) {
68
+ args.push("--disable-site-isolation-trials");
69
+ }
67
70
  const command = new Command(executablePath, { args, stdout: PIPED_STD_CONFIG, stderr: PIPED_STD_CONFIG });
68
71
  try {
69
72
  child = await command.spawn();
@@ -82,7 +85,7 @@ async function launchBrowser(options = {}, indexPath = 0) {
82
85
  return debugPort;
83
86
  }
84
87
 
85
- async function getDebugPort(port = 9222, usedPorts = []) {
88
+ async function getDebugPort(port = getRandomDebugPort(), usedPorts = []) {
86
89
  try {
87
90
  await fetch("http://localhost:" + port + "/json/version");
88
91
  } catch (error) {
@@ -91,7 +94,7 @@ async function getDebugPort(port = 9222, usedPorts = []) {
91
94
  if (usedPorts.length < DEBUG_PORT_RANGE) {
92
95
  usedPorts.push(port);
93
96
  do {
94
- port = Math.floor(Math.random() * DEBUG_PORT_RANGE) + DEBUG_PORT_MIN;
97
+ port = getRandomDebugPort();
95
98
  } while (usedPorts.includes(port));
96
99
  return getDebugPort(port, usedPorts);
97
100
  } else {
@@ -99,6 +102,11 @@ async function getDebugPort(port = 9222, usedPorts = []) {
99
102
  }
100
103
  }
101
104
 
105
+
106
+ function getRandomDebugPort() {
107
+ return Math.floor(Math.random() * DEBUG_PORT_RANGE) + DEBUG_PORT_MIN;
108
+ }
109
+
102
110
  async function closeBrowser() {
103
111
  if (child !== undefined) {
104
112
  child.kill();
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "2.0.31";
1
+ export const version = "2.0.33";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {