rechrome 1.5.0 → 1.7.0

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.
Files changed (6) hide show
  1. package/README.md +40 -20
  2. package/package.json +3 -3
  3. package/rech.js +608 -65
  4. package/rech.ts +608 -65
  5. package/serve.js +112 -13
  6. package/serve.ts +112 -13
package/README.md CHANGED
@@ -49,24 +49,27 @@ This auto-generates a connection URL in `.env.local` (with an auth key).
49
49
 
50
50
  ### 2. Run commands from a client
51
51
 
52
- Copy the `REMOTE_CHROME_URL` from the server's `.env.local` to the client:
52
+ Copy the `RECHROME_URL` from the server's `.env.local` to the client's project `.env.local`:
53
53
 
54
54
  ```bash
55
- export REMOTE_CHROME_URL=remote-chrome://YOUR_KEY@server-host:13775
55
+ # .env.local in your project directory
56
+ RECHROME_URL=http://YOUR_KEY@server-host:13775
56
57
 
57
58
  # Open a URL
58
- rechrome open https://example.com
59
+ rech open https://example.com
59
60
 
60
61
  # Take a screenshot
61
- rechrome screenshot
62
+ rech screenshot
62
63
 
63
64
  # List open tabs
64
- rechrome tab-list
65
+ rech tab-list
65
66
 
66
67
  # Any playwright-cli command works
67
- rechrome --help
68
+ rech --help
68
69
  ```
69
70
 
71
+ rechrome walks up from the current working directory to find `.env.local`, so each project can have its own connection URL, Chrome profile, and extension token.
72
+
70
73
  ## Configuration
71
74
 
72
75
  Copy `.env.example` to `.env.local` and edit:
@@ -75,22 +78,24 @@ Copy `.env.example` to `.env.local` and edit:
75
78
  cp .env.example .env.local
76
79
  ```
77
80
 
78
- | Variable | Description | Default |
79
- | -------------------------------- | -------------------------------------------------------------------------------------------------- | ---------------- |
80
- | `REMOTE_CHROME_URL` | Connection URL (auto-generated by `rechrome serve`) | — |
81
- | `PLAYWRIGHT_CLI` | Path to playwright-cli binary (recommended: `playwright-cli-multi-tab` for full multi-tab support) | `playwright-cli` |
82
- | `RECH_HOST` | Server bind address | `127.0.0.1` |
83
- | `PLAYWRIGHT_MCP_EXTENSION_ID` | Chrome extension ID (client overrides server) | — |
84
- | `PLAYWRIGHT_MCP_EXTENSION_TOKEN` | Chrome extension token (client overrides server) | — |
85
- | `PLAYWRIGHT_MCP_USER_DATA_DIR` | Chrome user data directory — use to pin connections to a specific Chrome install (client overrides server) | — |
86
- | `PLAYWRIGHT_MCP_PROFILE_DIRECTORY` | Chrome profile sub-directory (e.g. `Profile 2`) use when multiple profiles share the same user data dir (client overrides server) | — |
87
-
88
- > **Multi-profile tip:** If you have multiple Chrome profiles open and only one has the Playwright MCP Bridge extension, set both vars so the extension connection always targets the correct profile:
81
+ | Variable | Description | Default |
82
+ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
83
+ | `RECHROME_URL` | Connection URL (auto-generated by `rech serve`). Also accepts `?extension_id=`, `?token=`, `?profile=` query params | — |
84
+ | `PLAYWRIGHT_CLI` | Path to playwright-cli binary (recommended: `playwright-cli-multi-tab` for full multi-tab support) | `playwright-cli` |
85
+ | `RECH_HOST` | Server bind address | `127.0.0.1` |
86
+ | `PLAYWRIGHT_MCP_EXTENSION_ID` | Chrome extension ID (client overrides server) | — |
87
+ | `PLAYWRIGHT_MCP_EXTENSION_TOKEN` | Chrome extension token — profile-specific, get it from the extension's status page (client overrides server) | — |
88
+ | `PLAYWRIGHT_MCP_USER_DATA_DIR` | Chrome user data directory — use to pin connections to a specific Chrome install (client overrides server) | — |
89
+ | `PLAYWRIGHT_MCP_PROFILE_DIRECTORY` | Chrome profile — accepts directory name (`Profile 2`), display name (`Snowstar`), or **email** (`you@example.com`) (client overrides server) | — |
90
+
91
+ > **Multi-profile tip:** Each project's `.env.local` can specify a different Chrome profile via the `?profile=` query param in `RECHROME_URL`. The server resolves display names and email addresses to the actual Chrome profile directory automatically (reads `~/Library/Application Support/Google/Chrome/Local State`).
92
+ >
89
93
  > ```
90
- > PLAYWRIGHT_MCP_USER_DATA_DIR=/Users/yourname/Library/Application Support/Google/Chrome
91
- > PLAYWRIGHT_MCP_PROFILE_DIRECTORY=Profile 2
94
+ > # .env.local for a work project
95
+ > RECHROME_URL="http://KEY@server:13775?token=TOKEN&extension_id=EXT_ID&profile=taku%40company.com"
92
96
  > ```
93
- > To find your profile directory name, open `chrome://version` in the target Chrome profile and look for **Profile Path**.
97
+ >
98
+ > Shell-set `PLAYWRIGHT_MCP_*` variables take priority over `.env.local`, so you can always override per-command without editing files.
94
99
 
95
100
  ### Remote access
96
101
 
@@ -115,9 +120,24 @@ bun install
115
120
  bun test
116
121
  ```
117
122
 
123
+ ## Why we fork playwright
124
+
125
+ rechrome depends on [playwright-multi-tab](https://github.com/snomiao/playwright-multi-tab), which is a fork of [microsoft/playwright](https://github.com/microsoft/playwright). We maintain it because the upstream does not yet support several features required for rechrome's use case:
126
+
127
+ | Feature | Our change | Status |
128
+ |---------|-----------|--------|
129
+ | Multi-tab control | `playwright-multi-tab` fork adds `tab-new`, `tab-list`, `tab-select`, `tab-close` commands and a persistent session daemon | Not in upstream |
130
+ | `PLAYWRIGHT_MCP_EXTENSION_ID` | Lets you specify a custom extension ID instead of the hardcoded default | Not in upstream |
131
+ | `PLAYWRIGHT_MCP_PROFILE_DIRECTORY` | Passes `--profile-directory` to Chrome so the correct system profile is used; auto-detects the Chrome user data dir by OS | Not in upstream |
132
+
133
+ We also fork [playwright-mcp](https://github.com/snomiao/playwright-mcp) (inside `playwright-multi-tab/lib/playwright-mcp`) to support the custom extension ID and multi-tab session routing.
134
+
135
+ PRs upstream are welcome. Once these features land in the official packages we will drop the forks.
136
+
118
137
  ## Related
119
138
 
120
139
  - [playwright-multi-tab](https://github.com/snomiao/playwright-multi-tab) — the underlying Playwright fork powering rechrome's multi-tab and multi-session browser control
140
+ - [microsoft/playwright](https://github.com/microsoft/playwright) — upstream
121
141
 
122
142
  ## License
123
143
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "rechrome",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/snomiao/rechrome.git"
7
7
  },
8
8
  "bin": {
9
- "rech": "./rech.js",
10
- "rechrome": "./rech.js"
9
+ "rech": "./rech.ts",
10
+ "rechrome": "./rech.ts"
11
11
  },
12
12
  "files": [
13
13
  ".env.example",