@browserbridge/bbx 1.12.0 → 1.12.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/PRIVACY.md +1 -0
- package/package.json +1 -1
- package/packages/agent-client/src/cli-args.js +22 -3
- package/packages/agent-client/src/cli-batch.js +14 -3
- package/packages/agent-client/src/cli.js +4 -2
- package/packages/agent-client/src/command-registry.js +1 -1
- package/packages/agent-client/src/runtime.js +12 -7
- package/packages/mcp-server/src/guidance.js +2 -1
- package/packages/mcp-server/src/handlers-navigation.js +9 -4
- package/packages/mcp-server/src/handlers-page.js +14 -1
- package/packages/mcp-server/src/handlers-utils.js +175 -1
- package/packages/mcp-server/src/handlers.js +5 -1
- package/packages/mcp-server/src/server.js +51 -4
- package/packages/native-host/src/daemon.js +120 -10
- package/packages/native-host/src/native-host.js +40 -2
- package/packages/native-host/src/window-actions.js +115 -0
- package/packages/protocol/src/protocol.js +62 -1
- package/packages/protocol/src/types.ts +10 -0
- package/packages/protocol/src/window-access.ts +29 -0
- package/packages/protocol/src/window-actions.js +46 -0
- package/skills/browser-bridge/SKILL.md +21 -1
- package/skills/browser-bridge/references/capabilities.md +8 -6
|
@@ -121,6 +121,26 @@ In MCP mode, pass `destinationId` on any browser tool call instead; `browser_sta
|
|
|
121
121
|
|
|
122
122
|
Browser Bridge access is window-scoped. The user turns it on once for the current browser window in the popup or side panel.
|
|
123
123
|
|
|
124
|
+
### Multiple windows and profiles
|
|
125
|
+
|
|
126
|
+
Do not disable other windows or profiles to make routing work. `health.ping` returns `connectedExtensions`; its `access` status describes only the profile that answered. A restricted active tab there does not mean the requested page in another profile is unavailable.
|
|
127
|
+
|
|
128
|
+
In MCP, an unscoped `tabs.list` discovers tabs across enabled profiles. Choose the requested page by URL/title, then pass its `extensionId` and `tabId` on every call, including each batch item. Include `destinationId` for a remote machine. `tabId` and element refs are profile-local, so neither identifies a browser profile by itself. `targetBrowser` and `targetProfile` also work when their names uniquely identify a connection; prefer `extensionId` when labels are absent or duplicated.
|
|
129
|
+
|
|
130
|
+
Use the daemon connection's `extensionId`, not `browserExtensionId`, which identifies the installed Chrome extension and may be shared across profiles.
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{ "method": "page.get_state", "extensionId": "<connection ID from discovery>", "tabId": 123 }
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
CLI calls accept the same connection selector:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bbx call --extension '<connection ID from health.ping>' --tab 123 page.get_state '{}'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
When multiple connections match, calls fail with `TAB_MISMATCH` and `reason: ambiguous_browser_target` before reading or changing any page. Choose a connection from the error's `connectedExtensions`, list its tabs, and retry with the exact target. Connection IDs change on reconnect; rediscover a missing connection rather than falling back to another profile. Ask the user to enable access only for the selected profile if it is disabled.
|
|
143
|
+
|
|
124
144
|
To request access, call `access.request` (via `bbx access-request`, `browser_access` MCP tool, or `bbx call access.request`). This surfaces an Enable cue in the extension popup/side panel for the focused window.
|
|
125
145
|
|
|
126
146
|
Do not call `access.request` repeatedly while the same window is still pending. If access is already requested, tell the user to enable that window and wait for them to confirm readiness.
|
|
@@ -154,7 +174,7 @@ After access is enabled:
|
|
|
154
174
|
| `INPUT_FOCUS_CHANGED` | No | Inspect focus handlers; do not replay native text automatically |
|
|
155
175
|
| `DIALOG_NOT_OPEN` | No | Trigger or inspect the dialog again |
|
|
156
176
|
| `DIALOG_ACTION_CONFLICT` | No | Inspect current dialog state; never auto-repeat accept/dismiss |
|
|
157
|
-
| `TAB_MISMATCH` | No |
|
|
177
|
+
| `TAB_MISMATCH` | No | For `ambiguous_browser_target`, select `extensionId` and list its tabs. For a closed working tab, select a new `tabId`. Never disable unrelated windows. |
|
|
158
178
|
| `TIMEOUT` | Once | Retry once; if still failing, simplify (smaller `maxNodes`, narrower selector) |
|
|
159
179
|
| `CONTENT_SCRIPT_UNAVAILABLE` | No | Switch to a normal http(s) page in the enabled window |
|
|
160
180
|
| `EXTENSION_DISCONNECTED` | After 3s | Check Chrome is running; `bbx status` to verify, then retry |
|
|
@@ -9,15 +9,15 @@ Browser Bridge does not use capability-scoped sessions anymore.
|
|
|
9
9
|
## Access Model
|
|
10
10
|
|
|
11
11
|
1. The user turns Browser Bridge on for one browser window.
|
|
12
|
-
2.
|
|
13
|
-
3. Use `tabId`
|
|
12
|
+
2. With one connected profile, the first page call binds the session to its active tab. Later calls keep using that working tab even when browser focus changes.
|
|
13
|
+
3. Use `tabId` to choose a different working tab in the selected profile's enabled window.
|
|
14
14
|
4. Turning Browser Bridge off removes access immediately.
|
|
15
15
|
|
|
16
16
|
Once a window is enabled, the bridge can use all standard methods in that window, including debugger-backed methods when needed.
|
|
17
17
|
|
|
18
18
|
## Routing Defaults
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Default routing is safe when only one browser profile is connected:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
bbx status
|
|
@@ -25,7 +25,7 @@ bbx page-text
|
|
|
25
25
|
bbx dom-query main
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
If the user switches to another tab
|
|
28
|
+
If the user switches to another tab, Browser Bridge keeps using the session's working tab.
|
|
29
29
|
|
|
30
30
|
Use explicit `tabId` only for non-active tabs or deliberate side-by-side comparisons:
|
|
31
31
|
|
|
@@ -35,7 +35,9 @@ bbx call --tab 123 page.get_text
|
|
|
35
35
|
bbx call --tab 456 dom.query '{"selector":"main"}'
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
With multiple profiles, first use `health.ping` to read `connectedExtensions` or an unscoped MCP `tabs.list` to find the requested page across enabled profiles. Pass the selected `extensionId` and `tabId` on every MCP call, plus `destinationId` for a remote machine. Profile-local tab IDs and element refs are not globally unique. For CLI, use `bbx call --extension <connectionId> --tab <tabId> <method> '{...}'`. Browser/profile names are also available through MCP `targetBrowser`/`targetProfile` or CLI `--browser`/`--profile` when they uniquely identify a connection.
|
|
39
|
+
|
|
40
|
+
Ambiguous calls fail before reaching a page with `TAB_MISMATCH`, `reason: ambiguous_browser_target`, and connection choices. Never disable unrelated windows to route a call. Connection IDs change on reconnect, so rediscover a missing target rather than silently switching profiles.
|
|
39
41
|
|
|
40
42
|
## Access Failures
|
|
41
43
|
|
|
@@ -44,4 +46,4 @@ If a call fails with `ACCESS_DENIED`, `TAB_MISMATCH`, or another routing error:
|
|
|
44
46
|
1. Confirm the user enabled Browser Bridge for the correct browser window.
|
|
45
47
|
2. Confirm the target page is a normal web page, not a Chrome-restricted page.
|
|
46
48
|
3. If using explicit `tabId`, confirm that tab is inside the enabled window.
|
|
47
|
-
4.
|
|
49
|
+
4. For `ambiguous_browser_target`, choose a connection and list its tabs. Do not fall back to an unrelated active profile.
|