Skip to content

Commit 1083535

Browse files
committed
docs: snapshot Codex Chrome extension
1 parent 645a419 commit 1083535

22 files changed

Lines changed: 18905 additions & 31 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## [2026-05-08 14:43] | Task: snapshot Codex Chrome extension
2+
3+
### 🤖 Execution Context
4+
5+
- **Agent ID**: `Codex`
6+
- **Base Model**: `GPT-5`
7+
- **Runtime**: `Codex CLI`
8+
9+
### 📥 User Query
10+
11+
> Inspect the installed Codex Chrome Web Store extension and unpack it for the
12+
> extension backend path, complementing the existing IAB analysis.
13+
14+
### 🛠 Changes Overview
15+
16+
**Scope:** `docs/references`, `docs/wiki/browser-client/runtime`
17+
18+
**Key Actions:**
19+
20+
- **Captured extension snapshot**: Copied the installed Codex Chrome extension
21+
version `1.1.4` into `docs/references/codex-chrome-extension-1.1.4/raw/`.
22+
- **Generated readable sources**: Added formatted copies of the minified
23+
background, content script, popup JS, and popup CSS entry points.
24+
- **Updated architecture notes**: Replaced inferred Chrome extension backend
25+
topology with the confirmed native messaging plus MV3 service worker flow.
26+
27+
### 🧠 Design Intent (Why)
28+
29+
The repository already had IAB reverse-engineering notes. The public Chrome
30+
extension path is now locally observable, so preserving a versioned snapshot and
31+
documenting the confirmed transport split keeps future Agent work from relying
32+
on chat-only context or stale inference.
33+
34+
### 📁 Files Modified
35+
36+
- `docs/references/README.md`
37+
- `docs/references/codex-chrome-extension-1.1.4/`
38+
- `docs/wiki/browser-client/runtime/chrome-extension-architecture.md`

docs/references/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
长期演进的项目知识放在 `docs/wiki/`。例如 Browser Use 客户端的增量逆向
1414
结论维护在 `docs/wiki/browser-client/`,这里的 reference 文档保留首次分析
1515
的来源型记录。
16+
17+
## 已沉淀资料
18+
19+
- `codex-chrome-extension-1.1.4/`:Codex Chrome Web Store extension
20+
`hehggadaopoacecdllhhajmbjkdcmajg` 的本机安装快照、格式化入口文件和
21+
native messaging host 形状记录。
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Codex Chrome Extension 1.1.4 Snapshot
2+
3+
This directory is a local reverse-engineering snapshot of the public Codex
4+
Chrome Web Store extension:
5+
6+
- Extension ID: `hehggadaopoacecdllhhajmbjkdcmajg`
7+
- Extension name: `Codex`
8+
- Version: `1.1.4`
9+
- Manifest version: `3`
10+
- Snapshot date: `2026-05-08`
11+
12+
The raw files came from Chrome's installed extension directory. That directory
13+
contains the unpacked extension bundle, not browser profile data such as
14+
cookies, local storage, history databases, or passwords.
15+
16+
## Directory Layout
17+
18+
- `raw/`: byte-for-byte copy of the installed extension version directory.
19+
- `formatted/`: Prettier-formatted copies of the minified JS/CSS entry points
20+
for source reading only.
21+
- `native-host-manifest.sanitized.json`: sanitized copy of the Chrome native
22+
messaging host registration shape observed on this machine.
23+
24+
## Key Entry Points
25+
26+
- `raw/manifest.json`: MV3 manifest. The extension requests `nativeMessaging`,
27+
`debugger`, `tabs`, `tabGroups`, `downloads`, `history`, `scripting`,
28+
`storage`, and `<all_urls>`.
29+
- `raw/background.js`: minified service worker bundle.
30+
- `formatted/background.js`: readable copy of the service worker bundle.
31+
- `raw/content-scripts/codex.js`: injected cursor overlay content script.
32+
- `formatted/content-codex.js`: readable copy of the cursor overlay content
33+
script.
34+
- `raw/popup.html` and `raw/chunks/popup-47nmQnIc.js`: extension popup that
35+
reports native host connectivity and links to Chrome setup docs.
36+
37+
## Confirmed Runtime Shape
38+
39+
The service worker calls `chrome.runtime.connectNative` with
40+
`com.openai.codexextension`. The native messaging host registration allows only
41+
`chrome-extension://hehggadaopoacecdllhhajmbjkdcmajg/` and points at Codex's
42+
Chrome plugin `extension-host` binary.
43+
44+
At runtime, the native host process is launched by Google Chrome with the
45+
extension origin as an argument. The host owns an extension backend Unix socket
46+
under `/tmp/codex-browser-use/`, while the service worker talks to it through
47+
Chrome native messaging.
48+
49+
The service worker implements the Browser Use backend methods directly over the
50+
native messaging JSON-RPC bridge:
51+
52+
- `getInfo`: returns `{ name: "Chrome", type: "extension" }` plus extension
53+
metadata.
54+
- `createTab`, `getTabs`, `claimUserTab`, `finalizeTabs`, `nameSession`:
55+
manage Chrome tabs and tab groups for each Codex `session_id`.
56+
- `attach`, `detach`, `executeCdp`: use `chrome.debugger`.
57+
- `getUserTabs`, `getUserHistory`: read user browser tab/history surfaces.
58+
- `moveMouse`: drives the injected cursor overlay content script.
59+
60+
## Integrity Notes
61+
62+
Important hashes from the raw snapshot:
63+
64+
```text
65+
dbd1f29afff4fddb644281677c2eeee6a165bf8ca1ac9270df7fb892a7d3f4ea raw/background.js
66+
daa383cb2fa673cd3c98bd80b9d1135787d0a9a0a60cbdbce35a8853c952da8e raw/content-scripts/codex.js
67+
07259620aafb265a01976119acafcc4092dc9f9dfd2dc912c25c6b6e48045caa raw/manifest.json
68+
```
69+
70+
The native host binary is not copied into this reference directory. It is a
71+
Codex plugin artifact rather than a Chrome Web Store extension file.

0 commit comments

Comments
 (0)