single-file-cli 2.0.21 → 2.0.22
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/deno.json +2 -2
- package/deno.lock +8 -8
- package/lib/cdp-client.js +15 -15
- package/lib/version.js +1 -1
- package/options.js +1 -1
- package/package.json +2 -2
package/deno.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@single-file/single-file-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "SingleFile CLI",
|
|
5
5
|
"nodeModulesDir": true,
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./single-file-cli-api.js"
|
|
8
8
|
},
|
|
9
9
|
"imports": {
|
|
10
|
-
"simple-cdp": "jsr:@simple-cdp/simple-cdp@^1.8.
|
|
10
|
+
"simple-cdp": "jsr:@simple-cdp/simple-cdp@^1.8.5",
|
|
11
11
|
"path": "jsr:@std/path@^0.220.1"
|
|
12
12
|
}
|
|
13
13
|
}
|
package/deno.lock
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"version": "3",
|
|
3
3
|
"packages": {
|
|
4
4
|
"specifiers": {
|
|
5
|
-
"jsr:@simple-cdp/simple-cdp@^1.8.
|
|
5
|
+
"jsr:@simple-cdp/simple-cdp@^1.8.5": "jsr:@simple-cdp/simple-cdp@1.8.5",
|
|
6
6
|
"jsr:@std/assert@^0.220.1": "jsr:@std/assert@0.220.1",
|
|
7
7
|
"jsr:@std/path@^0.220.1": "jsr:@std/path@0.220.1",
|
|
8
|
-
"npm:simple-cdp@^1.8.
|
|
8
|
+
"npm:simple-cdp@^1.8.5": "npm:simple-cdp@1.8.5",
|
|
9
9
|
"npm:ws@^8.16.0": "npm:ws@8.16.0"
|
|
10
10
|
},
|
|
11
11
|
"jsr": {
|
|
12
|
-
"@simple-cdp/simple-cdp@1.8.
|
|
13
|
-
"integrity": "
|
|
12
|
+
"@simple-cdp/simple-cdp@1.8.5": {
|
|
13
|
+
"integrity": "7386ca561cd6293bb3115eadf14b8c98d1c41c35a69c79774ea70e5101159413"
|
|
14
14
|
},
|
|
15
15
|
"@std/assert@0.220.1": {
|
|
16
16
|
"integrity": "88710d54f3afdd7a5761e7805abba1f56cd14e4b212feffeb3e73a9f77482425"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"npm": {
|
|
26
|
-
"simple-cdp@1.8.
|
|
27
|
-
"integrity": "sha512-
|
|
26
|
+
"simple-cdp@1.8.5": {
|
|
27
|
+
"integrity": "sha512-bpXoeCk0mwFrr+8C8vVkhCug5h4HO49GI+MZdnyLQcFVKzTlokrimTjEoc69X2Y2n7mtjzDHTriq6B/kgUeUcA==",
|
|
28
28
|
"dependencies": {}
|
|
29
29
|
},
|
|
30
30
|
"ws@8.16.0": {
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"remote": {},
|
|
37
37
|
"workspace": {
|
|
38
38
|
"dependencies": [
|
|
39
|
-
"jsr:@simple-cdp/simple-cdp@^1.8.
|
|
39
|
+
"jsr:@simple-cdp/simple-cdp@^1.8.5",
|
|
40
40
|
"jsr:@std/path@^0.220.1"
|
|
41
41
|
],
|
|
42
42
|
"packageJson": {
|
|
43
43
|
"dependencies": [
|
|
44
|
-
"npm:simple-cdp@^1.8.
|
|
44
|
+
"npm:simple-cdp@^1.8.5",
|
|
45
45
|
"npm:ws@^8.16.0"
|
|
46
46
|
]
|
|
47
47
|
}
|
package/lib/cdp-client.js
CHANGED
|
@@ -37,10 +37,10 @@ const EMPTY_PAGE_URL = "about:blank";
|
|
|
37
37
|
export { initialize, getPageData, closeBrowser };
|
|
38
38
|
|
|
39
39
|
async function initialize(options) {
|
|
40
|
-
if (!options.
|
|
40
|
+
if (!options.browserRemoteDebuggingURL) {
|
|
41
41
|
await launchBrowser(getBrowserOptions(options));
|
|
42
42
|
} else {
|
|
43
|
-
CDP.remoteDebuggingUrl = options.
|
|
43
|
+
CDP.remoteDebuggingUrl = options.browserRemoteDebuggingURL;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -64,7 +64,7 @@ async function getPageData(options) {
|
|
|
64
64
|
if (options.browserMobileEmulation) {
|
|
65
65
|
await Emulation.setDeviceMetricsOverride({ mobile: true });
|
|
66
66
|
}
|
|
67
|
-
if (options.
|
|
67
|
+
if (options.httpProxyUsername) {
|
|
68
68
|
await Fetch.enable({ handleAuthRequests: true });
|
|
69
69
|
Fetch.addEventListener("authRequired", ({ params }) => Fetch.continueWithAuth({
|
|
70
70
|
requestId: params.requestId,
|
|
@@ -219,20 +219,20 @@ function getTopFrameContextId({ Page, Runtime }, options) {
|
|
|
219
219
|
contextIds.splice(index, 1);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
});
|
|
222
223
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
return false;
|
|
224
|
+
async function testExecutionContext(contextId) {
|
|
225
|
+
try {
|
|
226
|
+
const { result } = await Runtime.evaluate({
|
|
227
|
+
expression: "singlefile !== undefined",
|
|
228
|
+
contextId
|
|
229
|
+
});
|
|
230
|
+
return result.value === true;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
// ignored
|
|
234
233
|
}
|
|
235
|
-
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
function waitForLoadTimeout(abortSignal, maxDelay) {
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.0.
|
|
1
|
+
export const version = "2.0.22";
|
package/options.js
CHANGED
|
@@ -60,7 +60,7 @@ const OPTIONS_INFO = {
|
|
|
60
60
|
"browser-cookie": { description: "Ordered list of cookie parameters separated by a comma (name,value,domain,path,expires,httpOnly,secure,sameSite,url)", type: "string[]" },
|
|
61
61
|
"browser-cookies-file": { description: "Path of the cookies file formatted as a JSON file or a Netscape text file", type: "string" },
|
|
62
62
|
"browser-ignore-insecure-certs": { description: "Ignore HTTPs errors", type: "boolean" },
|
|
63
|
-
"browser-remote-debugging-
|
|
63
|
+
"browser-remote-debugging-URL": { description: "Remote debugging URL", type: "string" },
|
|
64
64
|
"compress-content": { description: "Compress the output file into a ZIP file", type: "boolean" },
|
|
65
65
|
"compress-CSS": { description: "Compress CSS stylesheets", type: "boolean" },
|
|
66
66
|
"compress-HTML": { description: "Compress HTML content", type: "boolean", defaultValue: true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "single-file-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "SingleFile CLI",
|
|
5
5
|
"author": "Gildas Lormeau",
|
|
6
6
|
"engines": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"single-file": "./single-file-node.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"simple-cdp": "^1.8.
|
|
16
|
+
"simple-cdp": "^1.8.5",
|
|
17
17
|
"ws": "^8.16.0"
|
|
18
18
|
}
|
|
19
19
|
}
|