@xbrowser/cli 1.25.1 → 1.25.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.
@@ -20,7 +20,7 @@ import {
20
20
  saveSessionDiskMeta,
21
21
  setActivePage,
22
22
  touchSession
23
- } from "./chunk-CRRR4KUO.js";
23
+ } from "./chunk-2EEAXSBA.js";
24
24
  import "./chunk-R3F4K2SB.js";
25
25
  import "./chunk-MYH6FIBZ.js";
26
26
  import "./chunk-GDKLH7ZY.js";
@@ -20,8 +20,8 @@ import {
20
20
  saveSessionDiskMeta,
21
21
  setActivePage,
22
22
  touchSession
23
- } from "./chunk-GBACWWFI.js";
24
- import "./chunk-ZGHLHBXX.js";
23
+ } from "./chunk-ZOYM7QMS.js";
24
+ import "./chunk-CGNHGAIJ.js";
25
25
  import "./chunk-A7NEA4PA.js";
26
26
  import "./chunk-R3F4K2SB.js";
27
27
  import "./chunk-MYH6FIBZ.js";
@@ -20,8 +20,8 @@ import {
20
20
  saveSessionDiskMeta,
21
21
  setActivePage,
22
22
  touchSession
23
- } from "./chunk-PZJSCKTI.js";
24
- import "./chunk-DP6VI3UL.js";
23
+ } from "./chunk-NNI5RT4A.js";
24
+ import "./chunk-U6GFDVNI.js";
25
25
  import "./chunk-R3F4K2SB.js";
26
26
  import "./chunk-MYH6FIBZ.js";
27
27
  import "./chunk-GDKLH7ZY.js";
@@ -14,7 +14,7 @@ import {
14
14
  scrollIntoView,
15
15
  waitForActionable,
16
16
  waitForNetworkIdle
17
- } from "./chunk-DP6VI3UL.js";
17
+ } from "./chunk-U6GFDVNI.js";
18
18
  import "./chunk-R3F4K2SB.js";
19
19
  import {
20
20
  connectToCDP,
@@ -14,7 +14,7 @@ import {
14
14
  scrollIntoView,
15
15
  waitForActionable,
16
16
  waitForNetworkIdle
17
- } from "./chunk-ZGHLHBXX.js";
17
+ } from "./chunk-CGNHGAIJ.js";
18
18
  import "./chunk-A7NEA4PA.js";
19
19
  import "./chunk-R3F4K2SB.js";
20
20
  import {
@@ -1844,6 +1844,23 @@ var XBPageImpl = class _XBPageImpl {
1844
1844
  );
1845
1845
  } catch {
1846
1846
  }
1847
+ try {
1848
+ const rawUa = await this.conn.send(
1849
+ "Runtime.evaluate",
1850
+ { expression: "navigator.userAgent", returnByValue: true },
1851
+ this.sessionId
1852
+ );
1853
+ const ua = rawUa?.value || "";
1854
+ const cleaned = ua.replace(/HeadlessChrome/g, "Chrome");
1855
+ if (cleaned !== ua) {
1856
+ await this.conn.send(
1857
+ "Network.setUserAgentOverride",
1858
+ { userAgent: cleaned },
1859
+ this.sessionId
1860
+ );
1861
+ }
1862
+ } catch {
1863
+ }
1847
1864
  }
1848
1865
  const result = await this.conn.send(
1849
1866
  "Page.navigate",
@@ -1849,6 +1849,23 @@ var XBPageImpl = class _XBPageImpl {
1849
1849
  );
1850
1850
  } catch {
1851
1851
  }
1852
+ try {
1853
+ const rawUa = await this.conn.send(
1854
+ "Runtime.evaluate",
1855
+ { expression: "navigator.userAgent", returnByValue: true },
1856
+ this.sessionId
1857
+ );
1858
+ const ua = rawUa?.value || "";
1859
+ const cleaned = ua.replace(/HeadlessChrome/g, "Chrome");
1860
+ if (cleaned !== ua) {
1861
+ await this.conn.send(
1862
+ "Network.setUserAgentOverride",
1863
+ { userAgent: cleaned },
1864
+ this.sessionId
1865
+ );
1866
+ }
1867
+ } catch {
1868
+ }
1852
1869
  }
1853
1870
  const result = await this.conn.send(
1854
1871
  "Page.navigate",
@@ -1745,6 +1745,23 @@ var XBPageImpl = class _XBPageImpl {
1745
1745
  );
1746
1746
  } catch {
1747
1747
  }
1748
+ try {
1749
+ const rawUa = await this.conn.send(
1750
+ "Runtime.evaluate",
1751
+ { expression: "navigator.userAgent", returnByValue: true },
1752
+ this.sessionId
1753
+ );
1754
+ const ua = rawUa?.value || "";
1755
+ const cleaned = ua.replace(/HeadlessChrome/g, "Chrome");
1756
+ if (cleaned !== ua) {
1757
+ await this.conn.send(
1758
+ "Network.setUserAgentOverride",
1759
+ { userAgent: cleaned },
1760
+ this.sessionId
1761
+ );
1762
+ }
1763
+ } catch {
1764
+ }
1748
1765
  }
1749
1766
  const result = await this.conn.send(
1750
1767
  "Page.navigate",
@@ -9,7 +9,7 @@ import {
9
9
  resolveLaunchOpts,
10
10
  saveSessionDiskMeta,
11
11
  setActivePage
12
- } from "./chunk-PZJSCKTI.js";
12
+ } from "./chunk-NNI5RT4A.js";
13
13
  import {
14
14
  detectAntiBot,
15
15
  formatDetectionMessage
@@ -8636,7 +8636,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
8636
8636
  }
8637
8637
  let targetPageOverride = null;
8638
8638
  if (_target && extraOpts?.cdpEndpoint) {
8639
- const { findTargetPage } = await import("./browser-AGFVVYPN.js");
8639
+ const { findTargetPage } = await import("./browser-L3TUDYY3.js");
8640
8640
  targetPageOverride = await findTargetPage(extraOpts.cdpEndpoint, _target);
8641
8641
  if (!targetPageOverride) {
8642
8642
  return errorResult(`Target "${_target}" not found. Use 'xbrowser targets --cdp ${extraOpts.cdpEndpoint}' to list available pages.`);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  launch
3
- } from "./chunk-DP6VI3UL.js";
3
+ } from "./chunk-U6GFDVNI.js";
4
4
  import {
5
5
  errMsg
6
6
  } from "./chunk-GDKLH7ZY.js";
@@ -20,7 +20,7 @@ import {
20
20
  resolveLaunchOpts,
21
21
  saveSessionDiskMeta,
22
22
  setActivePage
23
- } from "./chunk-CRRR4KUO.js";
23
+ } from "./chunk-2EEAXSBA.js";
24
24
  import {
25
25
  rand,
26
26
  sleep,
@@ -8319,7 +8319,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
8319
8319
  }
8320
8320
  let targetPageOverride = null;
8321
8321
  if (_target && extraOpts?.cdpEndpoint) {
8322
- const { findTargetPage } = await import("./browser-FIEYZRSV.js");
8322
+ const { findTargetPage } = await import("./browser-33QQWEDI.js");
8323
8323
  targetPageOverride = await findTargetPage(extraOpts.cdpEndpoint, _target);
8324
8324
  if (!targetPageOverride) {
8325
8325
  return errorResult(`Target "${_target}" not found. Use 'xbrowser targets --cdp ${extraOpts.cdpEndpoint}' to list available pages.`);
@@ -1846,6 +1846,23 @@ var XBPageImpl = class _XBPageImpl {
1846
1846
  );
1847
1847
  } catch {
1848
1848
  }
1849
+ try {
1850
+ const rawUa = await this.conn.send(
1851
+ "Runtime.evaluate",
1852
+ { expression: "navigator.userAgent", returnByValue: true },
1853
+ this.sessionId
1854
+ );
1855
+ const ua = rawUa?.value || "";
1856
+ const cleaned = ua.replace(/HeadlessChrome/g, "Chrome");
1857
+ if (cleaned !== ua) {
1858
+ await this.conn.send(
1859
+ "Network.setUserAgentOverride",
1860
+ { userAgent: cleaned },
1861
+ this.sessionId
1862
+ );
1863
+ }
1864
+ } catch {
1865
+ }
1849
1866
  }
1850
1867
  const result = await this.conn.send(
1851
1868
  "Page.navigate",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRuleEngine,
3
3
  launch
4
- } from "./chunk-ZGHLHBXX.js";
4
+ } from "./chunk-CGNHGAIJ.js";
5
5
  import {
6
6
  errMsg
7
7
  } from "./chunk-GDKLH7ZY.js";
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  loadHooks,
18
18
  parsePluginParams,
19
19
  readJsonFile
20
- } from "./chunk-55TCNPMB.js";
20
+ } from "./chunk-PO27V5UH.js";
21
21
  import "./chunk-JKVUFP3G.js";
22
22
  import {
23
23
  forwardCommandLog,
@@ -81,7 +81,7 @@ import {
81
81
  findSession,
82
82
  getAllSessions,
83
83
  saveSessionDiskMeta
84
- } from "./chunk-CRRR4KUO.js";
84
+ } from "./chunk-2EEAXSBA.js";
85
85
  import "./chunk-R3F4K2SB.js";
86
86
  import "./chunk-MYH6FIBZ.js";
87
87
  import {
@@ -6032,7 +6032,7 @@ Run "xbrowser ${command} ${subCommand} --help" to see available parameters.`
6032
6032
  const targetPage = pages[cmdTabIndex];
6033
6033
  await targetPage.bringToFront().catch(() => {
6034
6034
  });
6035
- const { setActivePage } = await import("./browser-FIEYZRSV.js");
6035
+ const { setActivePage } = await import("./browser-33QQWEDI.js");
6036
6036
  setActivePage(session, targetPage);
6037
6037
  }
6038
6038
  }
@@ -6297,7 +6297,7 @@ async function handleRemote(args, options, mode) {
6297
6297
  }
6298
6298
  }
6299
6299
  async function startMcpServer() {
6300
- const { startMcpStdio } = await import("./server-HITV2PS7.js");
6300
+ const { startMcpStdio } = await import("./server-EZJW6IHU.js");
6301
6301
  startMcpStdio();
6302
6302
  }
6303
6303
 
@@ -6316,7 +6316,7 @@ async function main() {
6316
6316
  const command = process.argv[2];
6317
6317
  const isLongRunning = command === "preview" || command === "serve" || command === "mcp";
6318
6318
  if (!isLongRunning) {
6319
- const { ensureProcessCanExit } = await import("./browser-FIEYZRSV.js");
6319
+ const { ensureProcessCanExit } = await import("./browser-33QQWEDI.js");
6320
6320
  await ensureProcessCanExit().catch(() => {
6321
6321
  });
6322
6322
  process.exit(process.exitCode || exitCode);
@@ -38,10 +38,10 @@ import {
38
38
  resolveLaunchOpts,
39
39
  saveSessionDiskMeta,
40
40
  setActivePage
41
- } from "./chunk-GBACWWFI.js";
41
+ } from "./chunk-ZOYM7QMS.js";
42
42
  import {
43
43
  createRuleEngine
44
- } from "./chunk-ZGHLHBXX.js";
44
+ } from "./chunk-CGNHGAIJ.js";
45
45
  import {
46
46
  queryJS
47
47
  } from "./chunk-A7NEA4PA.js";
@@ -7871,7 +7871,7 @@ async function executeCommand(commandName, params, sessionName = "default", extr
7871
7871
  }
7872
7872
  let targetPageOverride = null;
7873
7873
  if (_target && extraOpts?.cdpEndpoint) {
7874
- const { findTargetPage } = await import("./browser-PWBUGDTR.js");
7874
+ const { findTargetPage } = await import("./browser-4LOJSMWV.js");
7875
7875
  targetPageOverride = await findTargetPage(extraOpts.cdpEndpoint, _target);
7876
7876
  if (!targetPageOverride) {
7877
7877
  return errorResult(`Target "${_target}" not found. Use 'xbrowser targets --cdp ${extraOpts.cdpEndpoint}' to list available pages.`);
@@ -9711,7 +9711,7 @@ function createRPCHandler() {
9711
9711
  if (isNewFormat) {
9712
9712
  try {
9713
9713
  const replayErrors = [];
9714
- const { SessionReplayer } = await import("./session-replayer-ZCE45WSW.js");
9714
+ const { SessionReplayer } = await import("./session-replayer-PJIUH7KI.js");
9715
9715
  const replayer = new SessionReplayer({
9716
9716
  page: session.page,
9717
9717
  stepDelay: slowMo * 500,
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  splitCommand,
49
49
  waitForAIResponse,
50
50
  waitForPage
51
- } from "./chunk-RLWABNIE.js";
51
+ } from "./chunk-DRKL2RFQ.js";
52
52
  import {
53
53
  SessionRecorder
54
54
  } from "./chunk-IR6C24P7.js";
@@ -63,7 +63,7 @@ import {
63
63
  getBrowser,
64
64
  resetForTesting,
65
65
  saveSessionDiskMeta
66
- } from "./chunk-PZJSCKTI.js";
66
+ } from "./chunk-NNI5RT4A.js";
67
67
  import "./chunk-JKVUFP3G.js";
68
68
  import {
69
69
  forwardCommandLog,
@@ -120,7 +120,7 @@ import {
120
120
  generateJSScript,
121
121
  generatePythonScript
122
122
  } from "./chunk-ETCO4SNK.js";
123
- import "./chunk-DP6VI3UL.js";
123
+ import "./chunk-U6GFDVNI.js";
124
124
  import "./chunk-R3F4K2SB.js";
125
125
  import "./chunk-MYH6FIBZ.js";
126
126
  import {
@@ -6127,7 +6127,7 @@ Run "xbrowser ${command} ${subCommand} --help" to see available parameters.`
6127
6127
  const targetPage = pages[cmdTabIndex];
6128
6128
  await targetPage.bringToFront().catch(() => {
6129
6129
  });
6130
- const { setActivePage } = await import("./browser-AGFVVYPN.js");
6130
+ const { setActivePage } = await import("./browser-L3TUDYY3.js");
6131
6131
  setActivePage(session, targetPage);
6132
6132
  }
6133
6133
  }
@@ -6392,7 +6392,7 @@ async function handleRemote(args, options, mode) {
6392
6392
  }
6393
6393
  }
6394
6394
  async function startMcpServer() {
6395
- const { startMcpStdio } = await import("./server-APHNNIXO.js");
6395
+ const { startMcpStdio } = await import("./server-IBQGNDSB.js");
6396
6396
  startMcpStdio();
6397
6397
  }
6398
6398
 
@@ -9307,7 +9307,7 @@ var DataCollector = class {
9307
9307
  return results;
9308
9308
  }
9309
9309
  async createBrowserContext() {
9310
- const { launch } = await import("./cdp-driver-OQDGJ7FW.js");
9310
+ const { launch } = await import("./cdp-driver-5YVI5AIS.js");
9311
9311
  const { browser } = await launch({
9312
9312
  headless: true,
9313
9313
  args: ["--no-sandbox", "--disable-setuid-sandbox"]
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  executeChain,
3
3
  executeCommand
4
- } from "./chunk-55TCNPMB.js";
4
+ } from "./chunk-PO27V5UH.js";
5
5
  import "./chunk-JKVUFP3G.js";
6
6
  import "./chunk-3OD76SUE.js";
7
7
  import "./chunk-ZTHE5RBZ.js";
8
8
  import "./chunk-Q2DFJQGS.js";
9
- import "./chunk-CRRR4KUO.js";
9
+ import "./chunk-2EEAXSBA.js";
10
10
  import "./chunk-R3F4K2SB.js";
11
11
  import "./chunk-MYH6FIBZ.js";
12
12
  import "./chunk-GDKLH7ZY.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  executeChain,
3
3
  executeCommand
4
- } from "./chunk-RLWABNIE.js";
5
- import "./chunk-PZJSCKTI.js";
4
+ } from "./chunk-DRKL2RFQ.js";
5
+ import "./chunk-NNI5RT4A.js";
6
6
  import "./chunk-JKVUFP3G.js";
7
7
  import "./chunk-3OD76SUE.js";
8
8
  import "./chunk-ZTHE5RBZ.js";
9
9
  import "./chunk-Q2DFJQGS.js";
10
- import "./chunk-DP6VI3UL.js";
10
+ import "./chunk-U6GFDVNI.js";
11
11
  import "./chunk-R3F4K2SB.js";
12
12
  import "./chunk-MYH6FIBZ.js";
13
13
  import "./chunk-GDKLH7ZY.js";
@@ -61,7 +61,7 @@ var SessionReplayer = class {
61
61
  if (this.opts.page) {
62
62
  this.page = this.opts.page;
63
63
  } else if (this.opts.cdpUrl) {
64
- const { launch } = await import("./cdp-driver-SPVN2G5X.js");
64
+ const { launch } = await import("./cdp-driver-BYW7WY7E.js");
65
65
  const { browser } = await launch({ cdpEndpoint: this.opts.cdpUrl });
66
66
  let contexts = browser.contexts();
67
67
  for (let i = 0; i < 10 && contexts.length === 0; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xbrowser/cli",
3
- "version": "1.25.1",
3
+ "version": "1.25.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": {