@dbalabka/chrome-wsl 0.3.0 → 0.3.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/README.md +14 -0
- package/chrome-wsl +0 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,5 +69,19 @@ Then run:
|
|
|
69
69
|
- Chrome launch is skipped when port 9222 already listens on Windows (assumed active remote-debug session).
|
|
70
70
|
- For a different remote debugging port or Chrome path, edit `PORT` or `WINDOWS_CHROME_PATH` in `start_chrome_wsl.sh`.
|
|
71
71
|
|
|
72
|
+
## Chrome DevTools MCP configuration for agents
|
|
73
|
+
|
|
74
|
+
To use Windows Chrome with any agent running in WSL you have
|
|
75
|
+
to cofigure the DevTools to connect to `--browser-url=http://127.0.0.1:9222`.
|
|
76
|
+
|
|
77
|
+
### Codex
|
|
78
|
+
|
|
79
|
+
```toml
|
|
80
|
+
[mcp_servers.chome-devtools]
|
|
81
|
+
command = "npx"
|
|
82
|
+
args = ["-y", "chrome-devtools-mcp@latest", "--browser-url=http://127.0.0.1:9222"]
|
|
83
|
+
startup_timeout_sec = 20.0
|
|
84
|
+
```
|
|
85
|
+
|
|
72
86
|
## License
|
|
73
87
|
MIT License. See `LICENSE` for details.
|
package/chrome-wsl
CHANGED
|
@@ -118,10 +118,6 @@ port_listening_info() {
|
|
|
118
118
|
run_powershell "\$conns = Get-NetTCPConnection -LocalPort ${PORT} -ErrorAction SilentlyContinue | Select-Object -Property LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess; foreach (\$c in \$conns) { \$p = Get-Process -Id \$c.OwningProcess -ErrorAction SilentlyContinue; \$name = if (\$p) { \$p.Name } else { 'unknown' }; Write-Output (\"{0}:{1} owner={2} pid={3} state={4}\" -f \$c.LocalAddress, \$c.LocalPort, \$name, \$c.OwningProcess, \$c.State) }"
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
port_in_use_by_non_chrome() {
|
|
122
|
-
run_powershell "if (Get-NetTCPConnection -LocalPort ${PORT} -ErrorAction SilentlyContinue | Where-Object { \$p = Get-Process -Id \_.OwningProcess -ErrorAction SilentlyContinue; -not (\$p -and \$p.Name -eq 'chrome') }) { exit 0 } else { exit 1 }"
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
get_wsl_host_ip() {
|
|
126
122
|
local host_ip
|
|
127
123
|
host_ip=$(ip route | awk '/^default via / {print $3; exit}')
|
|
@@ -267,11 +263,6 @@ start_chrome() {
|
|
|
267
263
|
fi
|
|
268
264
|
fi
|
|
269
265
|
|
|
270
|
-
if port_in_use_by_non_chrome; then
|
|
271
|
-
err "Port ${PORT} is already in use by another process (not Chrome); details:"
|
|
272
|
-
port_listening_info
|
|
273
|
-
fi
|
|
274
|
-
|
|
275
266
|
local chrome_pid
|
|
276
267
|
chrome_pid=$(run_powershell "$chrome_cmd" | tr -d '\r' | head -n 1)
|
|
277
268
|
if [[ -n "${chrome_pid:-}" ]]; then
|