rechrome 1.3.0 → 1.4.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.
- package/.env.example +10 -2
- package/README.md +11 -2
- package/package.json +1 -1
- package/rech.js +2 -0
- package/rech.ts +2 -0
- package/serve.js +3 -3
- package/serve.ts +3 -3
package/.env.example
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Remote Chrome connection URL (auto-generated by `rech serve` if not set)
|
|
2
2
|
# REMOTE_CHROME_URL=remote-chrome://key@host:13775
|
|
3
3
|
|
|
4
|
-
# Custom playwright-cli binary
|
|
5
|
-
# For
|
|
4
|
+
# Custom playwright-cli binary (default: playwright-cli). Supports space-separated runtime prefix.
|
|
5
|
+
# For global install: PLAYWRIGHT_CLI=playwright-cli-multi-tab
|
|
6
|
+
# For local submodule (with bun): PLAYWRIGHT_CLI=bun ./lib/playwright-cli/playwright-cli.js
|
|
6
7
|
# PLAYWRIGHT_CLI=playwright-cli-multi-tab
|
|
7
8
|
|
|
8
9
|
# Bind address for the server (default: 127.0.0.1, use 0.0.0.0 for remote access)
|
|
@@ -11,3 +12,10 @@
|
|
|
11
12
|
# Playwright MCP extension settings (can be set on server or client; client overrides server)
|
|
12
13
|
# PLAYWRIGHT_MCP_EXTENSION_ID=your-extension-id
|
|
13
14
|
# PLAYWRIGHT_MCP_EXTENSION_TOKEN=your-extension-token
|
|
15
|
+
|
|
16
|
+
# Chrome profile to use when connecting via --extension (macOS/Windows multi-profile setups)
|
|
17
|
+
# Set USER_DATA_DIR to Chrome's user data directory, and PROFILE_DIRECTORY to the sub-profile name.
|
|
18
|
+
# macOS default: ~/Library/Application Support/Google/Chrome
|
|
19
|
+
# Profile names: Default, "Profile 1", "Profile 2", etc. (check chrome://version for yours)
|
|
20
|
+
# PLAYWRIGHT_MCP_USER_DATA_DIR=/Users/yourname/Library/Application Support/Google/Chrome
|
|
21
|
+
# PLAYWRIGHT_MCP_PROFILE_DIRECTORY=Profile 2
|
package/README.md
CHANGED
|
@@ -80,8 +80,17 @@ cp .env.example .env.local
|
|
|
80
80
|
| `REMOTE_CHROME_URL` | Connection URL (auto-generated by `rechrome serve`) | — |
|
|
81
81
|
| `PLAYWRIGHT_CLI` | Path to playwright-cli binary (recommended: `playwright-cli-multi-tab` for full multi-tab support) | `playwright-cli` |
|
|
82
82
|
| `RECH_HOST` | Server bind address | `127.0.0.1` |
|
|
83
|
-
| `PLAYWRIGHT_MCP_EXTENSION_ID`
|
|
84
|
-
| `PLAYWRIGHT_MCP_EXTENSION_TOKEN`
|
|
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:
|
|
89
|
+
> ```
|
|
90
|
+
> PLAYWRIGHT_MCP_USER_DATA_DIR=/Users/yourname/Library/Application Support/Google/Chrome
|
|
91
|
+
> PLAYWRIGHT_MCP_PROFILE_DIRECTORY=Profile 2
|
|
92
|
+
> ```
|
|
93
|
+
> To find your profile directory name, open `chrome://version` in the target Chrome profile and look for **Profile Path**.
|
|
85
94
|
|
|
86
95
|
### Remote access
|
|
87
96
|
|
package/package.json
CHANGED
package/rech.js
CHANGED
|
@@ -39,6 +39,8 @@ if (existsSync(envFile)) {
|
|
|
39
39
|
export const PASSTHROUGH_ENV_KEYS = [
|
|
40
40
|
"PLAYWRIGHT_MCP_EXTENSION_ID",
|
|
41
41
|
"PLAYWRIGHT_MCP_EXTENSION_TOKEN",
|
|
42
|
+
"PLAYWRIGHT_MCP_USER_DATA_DIR",
|
|
43
|
+
"PLAYWRIGHT_MCP_PROFILE_DIRECTORY",
|
|
42
44
|
] as const;
|
|
43
45
|
|
|
44
46
|
export function log(msg: string) {
|
package/rech.ts
CHANGED
|
@@ -39,6 +39,8 @@ if (existsSync(envFile)) {
|
|
|
39
39
|
export const PASSTHROUGH_ENV_KEYS = [
|
|
40
40
|
"PLAYWRIGHT_MCP_EXTENSION_ID",
|
|
41
41
|
"PLAYWRIGHT_MCP_EXTENSION_TOKEN",
|
|
42
|
+
"PLAYWRIGHT_MCP_USER_DATA_DIR",
|
|
43
|
+
"PLAYWRIGHT_MCP_PROFILE_DIRECTORY",
|
|
42
44
|
] as const;
|
|
43
45
|
|
|
44
46
|
export function log(msg: string) {
|
package/serve.js
CHANGED
|
@@ -93,7 +93,7 @@ export async function serve() {
|
|
|
93
93
|
});
|
|
94
94
|
const namespacedSession = clientSession ? `${sessionId}-${clientSession}` : sessionId;
|
|
95
95
|
|
|
96
|
-
const bin = process.env.PLAYWRIGHT_CLI || "playwright-cli";
|
|
96
|
+
const [bin, ...binArgs] = (process.env.PLAYWRIGHT_CLI || "playwright-cli").split(" ");
|
|
97
97
|
|
|
98
98
|
if (filteredArgs.length === 0) {
|
|
99
99
|
filteredArgs.push("--help");
|
|
@@ -105,7 +105,7 @@ export async function serve() {
|
|
|
105
105
|
const isOpenCmd = filteredArgs[0] === "open";
|
|
106
106
|
if (isOpenCmd) {
|
|
107
107
|
try {
|
|
108
|
-
const listProc = Bun.spawn([bin, "tab-list", "--extension", `-s=${namespacedSession}`], {
|
|
108
|
+
const listProc = Bun.spawn([bin, ...binArgs, "tab-list", "--extension", `-s=${namespacedSession}`], {
|
|
109
109
|
cwd: workDir,
|
|
110
110
|
stdin: "ignore",
|
|
111
111
|
stdout: "pipe",
|
|
@@ -147,7 +147,7 @@ export async function serve() {
|
|
|
147
147
|
...(clientName ? { PLAYWRIGHT_MCP_CLIENT_NAME: clientName } : {}),
|
|
148
148
|
...passthroughEnv,
|
|
149
149
|
};
|
|
150
|
-
const proc = Bun.spawn([bin, ...filteredArgs, "--extension", `-s=${namespacedSession}`], {
|
|
150
|
+
const proc = Bun.spawn([bin, ...binArgs, ...filteredArgs, "--extension", `-s=${namespacedSession}`], {
|
|
151
151
|
cwd: workDir,
|
|
152
152
|
stdin: "ignore",
|
|
153
153
|
stdout: "pipe",
|
package/serve.ts
CHANGED
|
@@ -93,7 +93,7 @@ export async function serve() {
|
|
|
93
93
|
});
|
|
94
94
|
const namespacedSession = clientSession ? `${sessionId}-${clientSession}` : sessionId;
|
|
95
95
|
|
|
96
|
-
const bin = process.env.PLAYWRIGHT_CLI || "playwright-cli";
|
|
96
|
+
const [bin, ...binArgs] = (process.env.PLAYWRIGHT_CLI || "playwright-cli").split(" ");
|
|
97
97
|
|
|
98
98
|
if (filteredArgs.length === 0) {
|
|
99
99
|
filteredArgs.push("--help");
|
|
@@ -105,7 +105,7 @@ export async function serve() {
|
|
|
105
105
|
const isOpenCmd = filteredArgs[0] === "open";
|
|
106
106
|
if (isOpenCmd) {
|
|
107
107
|
try {
|
|
108
|
-
const listProc = Bun.spawn([bin, "tab-list", "--extension", `-s=${namespacedSession}`], {
|
|
108
|
+
const listProc = Bun.spawn([bin, ...binArgs, "tab-list", "--extension", `-s=${namespacedSession}`], {
|
|
109
109
|
cwd: workDir,
|
|
110
110
|
stdin: "ignore",
|
|
111
111
|
stdout: "pipe",
|
|
@@ -147,7 +147,7 @@ export async function serve() {
|
|
|
147
147
|
...(clientName ? { PLAYWRIGHT_MCP_CLIENT_NAME: clientName } : {}),
|
|
148
148
|
...passthroughEnv,
|
|
149
149
|
};
|
|
150
|
-
const proc = Bun.spawn([bin, ...filteredArgs, "--extension", `-s=${namespacedSession}`], {
|
|
150
|
+
const proc = Bun.spawn([bin, ...binArgs, ...filteredArgs, "--extension", `-s=${namespacedSession}`], {
|
|
151
151
|
cwd: workDir,
|
|
152
152
|
stdin: "ignore",
|
|
153
153
|
stdout: "pipe",
|