single-file-cli 2.0.3 → 2.0.4
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/back-ends/chromium-back-end.js +1 -2
- package/deno-polyfill.js +2 -12
- package/deno.json +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import { launchBrowser, closeBrowser } from "./chromium-browser.js";
|
|
27
27
|
import { getScriptSource, getHookScriptSource } from "./single-file-script.js";
|
|
28
|
-
import {
|
|
28
|
+
import { CDP } from "simple-cdp";
|
|
29
29
|
|
|
30
30
|
const LOAD_TIMEOUT_ERROR = "ERR_LOAD_TIMEOUT";
|
|
31
31
|
const NETWORK_IDLE_STATE = "networkIdle";
|
|
@@ -42,7 +42,6 @@ async function initialize(options) {
|
|
|
42
42
|
|
|
43
43
|
async function getPageData(options) {
|
|
44
44
|
let targetInfo;
|
|
45
|
-
const CDP = await getCDP();
|
|
46
45
|
try {
|
|
47
46
|
const targetInfo = await CDP.createTarget({ url: EMPTY_PAGE_URL });
|
|
48
47
|
const { Browser, Security, Page, Emulation, Fetch, Network, Runtime, Debugger } = new CDP(targetInfo);
|
package/deno-polyfill.js
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/* global globalThis, URL, Deno, process */
|
|
25
25
|
|
|
26
26
|
import * as path from "path";
|
|
27
|
-
import { CDP } from "simple-cdp";
|
|
28
27
|
|
|
29
28
|
const DENO_RUNTIME_DETECTED = typeof Deno !== "undefined";
|
|
30
29
|
|
|
@@ -55,8 +54,7 @@ export {
|
|
|
55
54
|
errors,
|
|
56
55
|
Command,
|
|
57
56
|
toFileUrl,
|
|
58
|
-
dirname
|
|
59
|
-
getCDP
|
|
57
|
+
dirname
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
const args = DENO_RUNTIME_DETECTED ? Deno.args : process.argv.slice(2);
|
|
@@ -66,7 +64,7 @@ const stdout = {
|
|
|
66
64
|
};
|
|
67
65
|
|
|
68
66
|
const build = {
|
|
69
|
-
os: DENO_RUNTIME_DETECTED ? Deno.build.os : process.platform
|
|
67
|
+
os: DENO_RUNTIME_DETECTED ? Deno.build.os : process.platform == "win32" ? "windows" : process.platform
|
|
70
68
|
};
|
|
71
69
|
|
|
72
70
|
const errors = {
|
|
@@ -210,14 +208,6 @@ async function dirname(filePath) {
|
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
async function getCDP() {
|
|
214
|
-
if (DENO_RUNTIME_DETECTED) {
|
|
215
|
-
return CDP;
|
|
216
|
-
} else {
|
|
217
|
-
return CDP;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
211
|
function getNPMModule(module) {
|
|
222
212
|
return NPM_MODULES[module];
|
|
223
213
|
}
|
package/deno.json
CHANGED