@xbrowser/cli 1.2.1 → 1.2.2
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/dist/{chunk-XYXCS7JW.js → chunk-JPSFUFPG.js} +4 -2
- package/dist/chunk-PHBK3TRN.js +436 -0
- package/dist/cli.js +22 -8
- package/dist/{daemon-client-R4QWHD7V.js → daemon-client-COJQESU2.js} +4 -2
- package/dist/{daemon-client-ZHO6NG36.js → daemon-client-XXKMJZZ7.js} +1 -1
- package/dist/daemon-main.js +102 -495
- package/dist/index.js +22 -8
- package/dist/plugin-singleton-ZBVTWEYK.js +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
killAllDaemonProcesses,
|
|
26
26
|
startDaemonProcess,
|
|
27
27
|
stopDaemonProcess
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JPSFUFPG.js";
|
|
29
29
|
import {
|
|
30
30
|
CaptchaDetector,
|
|
31
31
|
HumanInteractionManager,
|
|
@@ -989,10 +989,10 @@ var setCookieCommand = registerCommand({
|
|
|
989
989
|
description: "Set a cookie",
|
|
990
990
|
scope: "page",
|
|
991
991
|
parameters: z8.object({
|
|
992
|
-
name: z8.string(),
|
|
993
|
-
value: z8.string(),
|
|
994
|
-
domain: z8.string().optional(),
|
|
995
|
-
path: z8.string().optional(),
|
|
992
|
+
name: z8.coerce.string(),
|
|
993
|
+
value: z8.coerce.string(),
|
|
994
|
+
domain: z8.coerce.string().optional(),
|
|
995
|
+
path: z8.coerce.string().optional(),
|
|
996
996
|
expires: z8.number().optional(),
|
|
997
997
|
httpOnly: z8.boolean().optional(),
|
|
998
998
|
secure: z8.boolean().optional(),
|
|
@@ -7368,7 +7368,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
|
|
|
7368
7368
|
params = result.data;
|
|
7369
7369
|
}
|
|
7370
7370
|
if (command.scope !== "cli" && !process.env.XBROWSER_DAEMON_WORKER) {
|
|
7371
|
-
const { forwardExec } = await import("./daemon-client-
|
|
7371
|
+
const { forwardExec } = await import("./daemon-client-XXKMJZZ7.js");
|
|
7372
7372
|
const result = await forwardExec(commandName, params, sessionName, extraOpts?.cdpEndpoint);
|
|
7373
7373
|
if (result) return result;
|
|
7374
7374
|
}
|
|
@@ -10612,6 +10612,18 @@ async function handlePlugin(args, options, mode) {
|
|
|
10612
10612
|
await (await getPluginLoader()).reloadPlugin(result.name);
|
|
10613
10613
|
} catch {
|
|
10614
10614
|
}
|
|
10615
|
+
try {
|
|
10616
|
+
const { daemonPing } = await import("./daemon-client-XXKMJZZ7.js");
|
|
10617
|
+
if (await daemonPing()) {
|
|
10618
|
+
await fetch("http://localhost:9224/rpc", {
|
|
10619
|
+
method: "POST",
|
|
10620
|
+
headers: { "Content-Type": "application/json" },
|
|
10621
|
+
body: JSON.stringify({ method: "plugins:reload", params: {} }),
|
|
10622
|
+
signal: AbortSignal.timeout(5e3)
|
|
10623
|
+
});
|
|
10624
|
+
}
|
|
10625
|
+
} catch {
|
|
10626
|
+
}
|
|
10615
10627
|
outputResult(
|
|
10616
10628
|
{ ok: true, name: result.name, source: result.source, path: result.path },
|
|
10617
10629
|
mode
|
|
@@ -10767,7 +10779,8 @@ async function handleRecord(args, options, mode) {
|
|
|
10767
10779
|
}
|
|
10768
10780
|
case "stop": {
|
|
10769
10781
|
const sessionName = options.session || "default";
|
|
10770
|
-
const
|
|
10782
|
+
const output = options.output || options.o;
|
|
10783
|
+
const result = await forwardRecordStop(sessionName, output);
|
|
10771
10784
|
if (!result.ok) {
|
|
10772
10785
|
outputError(String(result.error || "Failed to stop recording"));
|
|
10773
10786
|
return;
|
|
@@ -10776,6 +10789,7 @@ async function handleRecord(args, options, mode) {
|
|
|
10776
10789
|
ok: true,
|
|
10777
10790
|
message: "Recording stopped.",
|
|
10778
10791
|
sessionName,
|
|
10792
|
+
output: result.output || (output || SessionRecorder.getRecordingsDir(sessionName) + "/recording.json"),
|
|
10779
10793
|
actions: result.actions,
|
|
10780
10794
|
network: result.network,
|
|
10781
10795
|
durationMs: result.durationMs,
|
|
@@ -12889,7 +12903,7 @@ Run "xbrowser ${command} ${subCommand} --help" to see available parameters.`
|
|
|
12889
12903
|
}
|
|
12890
12904
|
const needsBrowser = cmdEntry.scope === "page" || cmdEntry.scope === "browser";
|
|
12891
12905
|
if (needsBrowser && !process.env.XBROWSER_DAEMON_WORKER) {
|
|
12892
|
-
const { forwardExec } = await import("./daemon-client-
|
|
12906
|
+
const { forwardExec } = await import("./daemon-client-XXKMJZZ7.js");
|
|
12893
12907
|
const userTimeout = typeof params.timeout === "number" && params.timeout > 0 ? params.timeout * 1e3 + 3e4 : void 0;
|
|
12894
12908
|
const result = await forwardExec(`${command}.${subCommand}`, params, sessionName, cdpEndpoint, userTimeout);
|
|
12895
12909
|
const resultData = result && typeof result === "object" && "data" in result ? result.data : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbrowser/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Browser automation CLI for web scraping, headless browsing, SEO analysis, and AI agent workflows. A command-line alternative to Playwright, Puppeteer, and Selenium.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|