@xbrowser/cli 1.22.0 → 1.23.0
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/README.md +20 -3
- package/dist/{chunk-PIWNMC36.js → chunk-A3MORKYR.js} +1 -1
- package/dist/{chunk-OMU63E6J.js → chunk-FBQZ3PVD.js} +5 -8
- package/dist/{chunk-TEXCXIBW.js → chunk-LPW6QS4M.js} +5 -8
- package/dist/{chunk-NKW4A74J.js → chunk-XTUAUFL3.js} +5 -8
- package/dist/cli.js +475 -242
- package/dist/daemon-main.js +6 -6
- package/dist/{human-interaction-Y5IDH6LD.js → human-interaction-57VYIR56.js} +1 -1
- package/dist/{human-interaction-ZUTR5AC2.js → human-interaction-67K43B4O.js} +1 -1
- package/dist/{human-interaction-4YR2N6R6.js → human-interaction-MXST5ZQM.js} +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.js +477 -244
- package/dist/{plugin-singleton-FCNDN3FX.js → plugin-singleton-GJO7EZXB.js} +1 -1
- package/dist/{recovery-NXC35EQN.js → recovery-6RI2FE3E.js} +1 -1
- package/dist/{recovery-MDWAVXE4.js → recovery-LGY25LIM.js} +1 -1
- package/dist/{recovery-L5GLDX4O.js → recovery-LMJW537X.js} +1 -1
- package/dist/{session-replayer-XM5L7LFD.js → session-replayer-N665T3G5.js} +22 -17
- package/package.json +11 -7
package/dist/daemon-main.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-JKVUFP3G.js";
|
|
5
5
|
import {
|
|
6
6
|
getPluginLoader
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-A3MORKYR.js";
|
|
8
8
|
import {
|
|
9
9
|
version
|
|
10
10
|
} from "./chunk-43TEMG4U.js";
|
|
@@ -7985,7 +7985,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
|
|
|
7985
7985
|
const errorMessage = errMsg(err);
|
|
7986
7986
|
if (session?.page && process.env.XBROWSER_RECOVERY && !extraOpts?._recoveryAttempted) {
|
|
7987
7987
|
try {
|
|
7988
|
-
const { attemptRecovery } = await import("./recovery-
|
|
7988
|
+
const { attemptRecovery } = await import("./recovery-LGY25LIM.js");
|
|
7989
7989
|
const recovery = await attemptRecovery(
|
|
7990
7990
|
session.page,
|
|
7991
7991
|
sessionName,
|
|
@@ -9025,7 +9025,7 @@ function createRPCHandler() {
|
|
|
9025
9025
|
return result;
|
|
9026
9026
|
} catch (err) {
|
|
9027
9027
|
const errorMessage = errMsg(err);
|
|
9028
|
-
const { attemptRecovery } = await import("./recovery-
|
|
9028
|
+
const { attemptRecovery } = await import("./recovery-LGY25LIM.js");
|
|
9029
9029
|
const recovery = await attemptRecovery(
|
|
9030
9030
|
session?.page,
|
|
9031
9031
|
sessionName,
|
|
@@ -9192,9 +9192,9 @@ function createRPCHandler() {
|
|
|
9192
9192
|
return result;
|
|
9193
9193
|
}
|
|
9194
9194
|
async function handlePluginsReload() {
|
|
9195
|
-
const { resetPluginLoader } = await import("./plugin-singleton-
|
|
9195
|
+
const { resetPluginLoader } = await import("./plugin-singleton-GJO7EZXB.js");
|
|
9196
9196
|
resetPluginLoader();
|
|
9197
|
-
const loader = await import("./plugin-singleton-
|
|
9197
|
+
const loader = await import("./plugin-singleton-GJO7EZXB.js").then((m) => m.getPluginLoader());
|
|
9198
9198
|
const sites = loader.getCore().loader.getSites();
|
|
9199
9199
|
return { ok: true, plugins: sites.length };
|
|
9200
9200
|
}
|
|
@@ -9590,7 +9590,7 @@ function createRPCHandler() {
|
|
|
9590
9590
|
if (isNewFormat) {
|
|
9591
9591
|
try {
|
|
9592
9592
|
const replayErrors = [];
|
|
9593
|
-
const { SessionReplayer } = await import("./session-replayer-
|
|
9593
|
+
const { SessionReplayer } = await import("./session-replayer-N665T3G5.js");
|
|
9594
9594
|
const replayer = new SessionReplayer({
|
|
9595
9595
|
page: session.page,
|
|
9596
9596
|
stepDelay: slowMo * 500,
|
package/dist/index.d.ts
CHANGED
|
@@ -1148,7 +1148,7 @@ interface DetectionConfig {
|
|
|
1148
1148
|
* along with optional `waitForHuman` (CAPTCHA handling) and
|
|
1149
1149
|
* `detectAntiBot` (anti-bot detection) capabilities.
|
|
1150
1150
|
*/
|
|
1151
|
-
interface BrowserCommandContext extends CommandContext {
|
|
1151
|
+
interface BrowserCommandContext extends Omit<CommandContext, 'waitForHuman' | 'detectAntiBot' | 'page'> {
|
|
1152
1152
|
page: XBPage;
|
|
1153
1153
|
browser: XBBrowser;
|
|
1154
1154
|
browserContext: XBContext;
|
|
@@ -2944,26 +2944,38 @@ interface HTTPServerConfig {
|
|
|
2944
2944
|
port?: number;
|
|
2945
2945
|
host?: string;
|
|
2946
2946
|
tokens?: string[];
|
|
2947
|
+
/**
|
|
2948
|
+
* Explicit CORS origin allowlist for remote web clients (e.g.
|
|
2949
|
+
* `['https://app.example']`, or `['*']` to opt back into wildcard).
|
|
2950
|
+
* When omitted, only loopback browser origins are granted CORS.
|
|
2951
|
+
*/
|
|
2952
|
+
corsOrigins?: string[];
|
|
2947
2953
|
}
|
|
2948
2954
|
|
|
2949
2955
|
/**
|
|
2950
2956
|
* HTTP server exposing the xbrowser REST API for remote command execution.
|
|
2951
2957
|
*
|
|
2952
2958
|
* Provides endpoints for health checks, session management, single command
|
|
2953
|
-
* execution, and command chain execution. Supports
|
|
2959
|
+
* execution, and command chain execution. Supports Bearer token
|
|
2954
2960
|
* authentication via config or environment variable.
|
|
2961
|
+
*
|
|
2962
|
+
* Secure defaults: binds loopback (127.0.0.1) only, and grants CORS only
|
|
2963
|
+
* to loopback browser origins. Binding a non-loopback host requires a
|
|
2964
|
+
* token — `start()` refuses otherwise.
|
|
2955
2965
|
*/
|
|
2956
2966
|
declare class HTTPServer {
|
|
2957
2967
|
private port;
|
|
2958
2968
|
private host;
|
|
2959
2969
|
private server;
|
|
2960
2970
|
private validTokens;
|
|
2971
|
+
private corsOrigins;
|
|
2961
2972
|
constructor(config?: HTTPServerConfig);
|
|
2962
2973
|
/**
|
|
2963
2974
|
* Start the HTTP server and begin listening for requests.
|
|
2964
2975
|
*
|
|
2965
2976
|
* @returns The actual port and host the server bound to.
|
|
2966
|
-
* @throws If the server is already running
|
|
2977
|
+
* @throws If the server is already running, if binding a non-loopback
|
|
2978
|
+
* host without an auth token, or if the port cannot be bound.
|
|
2967
2979
|
*/
|
|
2968
2980
|
start(): Promise<{
|
|
2969
2981
|
port: number;
|