You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d839e8
Browse filesBrowse the repository at this point in the historyBrowse files
feat(browser-bridge): offer the extension this build speaks to, and report a stale one honestly
The browser will not install an extension for the person: a store install needs their
own click, and an unpacked install needs developer mode and a folder they pick. What
the host can do is make sure the package they get is the one this build produces — a
stale extension is the failure that reads like a network timeout and costs an
afternoon.
The host rebuilds the extension when its sources are newer than its build, packs it
as a zip, and serves it at GET /browser-extension behind the per-start credential.
Settings → 浏览器 → 下载最新扩展包 links it; the link carries the token because the
route is admitted like every other document the host serves. A host that carries no
extension answers 404 rather than an empty archive, because an empty package reads
like a download that worked.
The other half is the report. A session that goes away while a command is in flight
is a disconnection, not a timeout: nothing was late, the peer hung up, and the two
call for opposite responses. The peer announces its build in the handshake and the
host knows the build it ships, so the message names the versions instead of leaving
the reader to look for a network problem that is not there. The extension's version
follows its protocol (0.2.0): the open-tab frame is a protocol change, and a host
that speaks it has to be able to tell an older extension from a current one.
Copy file name to clipboardExpand all lines: packages/webui/docs/browser-use/03-extension-admission.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,25 @@ path.
239
239
|**The peer is authenticated against a local process**|`implemented` — the `Origin` header still selects the allowlisted extension id, and it is no longer the thing that decides. A peer must additionally prove possession of the **installation key** before the host hands over a pairing credential, and a peer that proves only a credential this host already issued receives no credential at all. A local process can spoof the origin and supply its own ECDH key, but it holds neither secret, so no `pair` frame is sent to it. See [`04-pairing-credentials.md`](04-pairing-credentials.md)|
240
240
|**The specific refusal says what is missing**|`implemented` — `BrowserBridgeProofRefusal` distinguishes `switched_off`, `unknown_nonce`, `unknown_key_id`, `installation_key_mismatch`, `pairing_credential_mismatch` and `no_peer_public_key`, and each maps to its own stable `closed`-frame reason text in `describeRefusal` (`session.ts`). A generic "pairing proof failed" would leave the person unable to tell "paste your installation key" from "your host rotated". |
241
241
242
+
## Updating the extension, and what loading a new build costs
243
+
244
+
**`implemented`.** The browser does not install an extension for the person: a store install needs
245
+
their own click in the store, and an unpacked install needs developer mode and a folder they pick.
246
+
What the host can do is make sure the package they get is the one this build speaks to, because a
247
+
stale extension is the failure that reads like a network timeout and costs an afternoon.
248
+
249
+
| Element | State |
250
+
| --- | --- |
251
+
| The host builds the extension when its sources are newer than its build |`implemented` — `ensureCurrentBuild`, `packages/webui/src/server/browser-bridge/extension-package.ts`|
252
+
| The package is served as a download, behind the per-start credential |`implemented` — `GET /browser-extension`, `packages/webui/src/server/http/browser-extension.ts`; the name carries the version, so two packages are told apart |
253
+
| The person is offered it in one place |`implemented` — 浏览器 → 下载最新扩展包, `packages/webui/src/client/features/browser/ui/BrowserSettingsPage.public.tsx`|
254
+
| A host with no extension says so |`implemented` — the route answers `404`, never an empty archive, because an empty package reads like a download that worked |
255
+
256
+
Loading the package costs one thing, and the Settings page says so: an unpacked extension's id is
257
+
derived from the folder it is loaded from, so a new folder is a **new identity**. The person pairs
258
+
it again with the installation key from the same Settings page, and the development host learns the
259
+
new identity from that proof rather than from a configuration the person cannot know.
0 commit comments