bb-browser 0.11.0 → 0.11.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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/chunk-FSL4RNI6.js +53 -0
- package/dist/chunk-FSL4RNI6.js.map +1 -0
- package/dist/{chunk-5WGFUZLM.js → chunk-H2VEQBAU.js} +2 -2
- package/dist/{chunk-5WGFUZLM.js.map → chunk-H2VEQBAU.js.map} +1 -1
- package/dist/cli.js +374 -70
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +48 -39
- package/dist/daemon.js.map +1 -1
- package/dist/mcp.js +25 -4
- package/dist/mcp.js.map +1 -1
- package/dist/{openclaw-bridge-Q6EFUQCH.js → openclaw-bridge-4XJKWEQ3.js} +14 -51
- package/dist/openclaw-bridge-4XJKWEQ3.js.map +1 -0
- package/package.json +4 -5
- package/dist/openclaw-bridge-Q6EFUQCH.js.map +0 -1
- package/extension/background.js +0 -3258
- package/extension/background.js.map +0 -1
- package/extension/content/trace.js +0 -339
- package/extension/content/trace.js.map +0 -1
- package/extension/manifest.json +0 -45
- package/extension/options.html +0 -26
- package/extension/options.js +0 -19
- package/extension/options.js.map +0 -1
- /package/{extension → packages/shared}/buildDomTree.js +0 -0
package/dist/mcp.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
COMMAND_TIMEOUT,
|
|
4
4
|
DAEMON_BASE_URL,
|
|
5
5
|
generateId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H2VEQBAU.js";
|
|
7
7
|
import {
|
|
8
8
|
__commonJS,
|
|
9
9
|
__export,
|
|
@@ -21003,13 +21003,34 @@ async function isDaemonRunning() {
|
|
|
21003
21003
|
}
|
|
21004
21004
|
async function ensureDaemon() {
|
|
21005
21005
|
if (await isDaemonRunning()) return;
|
|
21006
|
-
|
|
21006
|
+
let cdpArgs = [];
|
|
21007
|
+
try {
|
|
21008
|
+
const cliPath = getCliPath();
|
|
21009
|
+
await new Promise((resolve2, reject) => {
|
|
21010
|
+
execFile(process.execPath, [cliPath, "daemon", "status", "--json"], { timeout: 15e3 }, (err, stdout) => {
|
|
21011
|
+
if (err) reject(err);
|
|
21012
|
+
else resolve2(stdout);
|
|
21013
|
+
});
|
|
21014
|
+
});
|
|
21015
|
+
if (await isDaemonRunning()) return;
|
|
21016
|
+
} catch {
|
|
21017
|
+
const { readFile } = await import("fs/promises");
|
|
21018
|
+
const os = await import("os");
|
|
21019
|
+
const path = await import("path");
|
|
21020
|
+
try {
|
|
21021
|
+
const portFile = path.join(os.default.homedir(), ".bb-browser", "browser", "cdp-port");
|
|
21022
|
+
const port = (await readFile(portFile, "utf8")).trim();
|
|
21023
|
+
if (port) cdpArgs = ["--cdp-port", port];
|
|
21024
|
+
} catch {
|
|
21025
|
+
}
|
|
21026
|
+
}
|
|
21027
|
+
const child = spawn(process.execPath, [getDaemonPath(), ...cdpArgs], {
|
|
21007
21028
|
detached: true,
|
|
21008
21029
|
stdio: "ignore",
|
|
21009
21030
|
env: { ...process.env }
|
|
21010
21031
|
});
|
|
21011
21032
|
child.unref();
|
|
21012
|
-
for (let i = 0; i <
|
|
21033
|
+
for (let i = 0; i < 50; i++) {
|
|
21013
21034
|
await new Promise((r) => setTimeout(r, 200));
|
|
21014
21035
|
if (await isDaemonRunning()) return;
|
|
21015
21036
|
}
|
|
@@ -21150,7 +21171,7 @@ async function runSiteCli(args) {
|
|
|
21150
21171
|
return parsed ?? result.stdout.trim();
|
|
21151
21172
|
}
|
|
21152
21173
|
var server = new McpServer(
|
|
21153
|
-
{ name: "bb-browser", version: "0.11.
|
|
21174
|
+
{ name: "bb-browser", version: "0.11.2" },
|
|
21154
21175
|
{ instructions: `bb-browser lets you control the user's real Chrome browser via CDP (Chrome DevTools Protocol).
|
|
21155
21176
|
|
|
21156
21177
|
Your browser is the API. No headless browser, no cookie extraction, no anti-bot bypass.
|