wsl-chrome-bridge 0.1.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/LICENSE.md +201 -0
- package/README.md +164 -0
- package/dist/arg-normalizer.d.ts +6 -0
- package/dist/arg-normalizer.js +37 -0
- package/dist/arg-normalizer.js.map +1 -0
- package/dist/bridge-options.d.ts +14 -0
- package/dist/bridge-options.js +210 -0
- package/dist/bridge-options.js.map +1 -0
- package/dist/bridge-runner.d.ts +1 -0
- package/dist/bridge-runner.js +425 -0
- package/dist/bridge-runner.js.map +1 -0
- package/dist/chrome-command.d.ts +7 -0
- package/dist/chrome-command.js +26 -0
- package/dist/chrome-command.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +12 -0
- package/dist/main.js.map +1 -0
- package/dist/path-utils.d.ts +6 -0
- package/dist/path-utils.js +39 -0
- package/dist/path-utils.js.map +1 -0
- package/dist/powershell.d.ts +22 -0
- package/dist/powershell.js +79 -0
- package/dist/powershell.js.map +1 -0
- package/package.json +42 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# wsl-chrome-bridge
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<a href="./README-zh.md">
|
|
5
|
+
<strong><span style="font-size: 1.2em;">[繁體中文說明請按此]</span></strong>
|
|
6
|
+
</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
This project provides a CLI tool: `wsl-chrome-bridge`.
|
|
10
|
+
|
|
11
|
+
From `chrome-devtools-mcp`'s perspective, `wsl-chrome-bridge` behaves like a Chrome executable.
|
|
12
|
+
It provides a DevTools connection entry in WSL and bridges CDP messages to Windows Chrome.
|
|
13
|
+
|
|
14
|
+
With the original `chrome-devtools-mcp` setup, you only need to change `--executablePath` and add a few bridge-specific arguments to let WSL agents control Windows Chrome, without system-level setup (for example `netsh interface portproxy` forwarding or WSL2 mirrored mode).
|
|
15
|
+
|
|
16
|
+
This idea came from [wsl-chrome-mcp](https://github.com/477174/wsl-chrome-mcp), which uses PowerShell to work around the same limitation. That project provides MCP server capability itself, while this project keeps using the widely maintained `chrome-devtools-mcp` and adds a bridge layer.
|
|
17
|
+
|
|
18
|
+
## How It Works
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
[chrome-devtools-mcp]
|
|
22
|
+
|
|
|
23
|
+
stdio pipe
|
|
24
|
+
|
|
|
25
|
+
[wsl-chrome-bridge]
|
|
26
|
+
|
|
|
27
|
+
PowerShell websocket relay
|
|
28
|
+
|
|
|
29
|
+
[Windows Chrome]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`wsl-chrome-bridge` will:
|
|
33
|
+
|
|
34
|
+
- Accept Chrome launch arguments from `chrome-devtools-mcp`
|
|
35
|
+
- Launch Windows Chrome via PowerShell
|
|
36
|
+
- Receive/return CDP messages through stdio pipe (OS pipe)
|
|
37
|
+
- Relay CDP messages bidirectionally to Windows Chrome through PowerShell websocket relay
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
- Windows 11 with the latest Chrome installed
|
|
42
|
+
- `powershell.exe` available for WSL2
|
|
43
|
+
- Node 20+
|
|
44
|
+
|
|
45
|
+
## Install and Use
|
|
46
|
+
|
|
47
|
+
### Install
|
|
48
|
+
|
|
49
|
+
1. Install globally with `npm install -g wsl-chrome-bridge`.
|
|
50
|
+
2. Or clone source and install with `npm link`.
|
|
51
|
+
|
|
52
|
+
### Example (Codex)
|
|
53
|
+
|
|
54
|
+
1. Find the actual path of `wsl-chrome-bridge`, for example `/home/pigochu/.local/share/mise/shims/wsl-chrome-bridge`.
|
|
55
|
+
2. Configure `.codex/config.toml` like this:
|
|
56
|
+
|
|
57
|
+
```toml
|
|
58
|
+
[sandbox_workspace_write]
|
|
59
|
+
network_access = true
|
|
60
|
+
|
|
61
|
+
[mcp_servers.chrome-devtools]
|
|
62
|
+
command = "npx"
|
|
63
|
+
args = [
|
|
64
|
+
"-y",
|
|
65
|
+
"chrome-devtools-mcp@latest",
|
|
66
|
+
"--executablePath",
|
|
67
|
+
"/home/pigochu/.local/share/mise/shims/wsl-chrome-bridge",
|
|
68
|
+
"--chrome-arg=--window-size=720,400",
|
|
69
|
+
"--chrome-arg=--new-window",
|
|
70
|
+
"--chrome-arg=--user-data-dir=%TEMP%\\wsl-chrome-bridge\\chrome-profile-test",
|
|
71
|
+
"--chrome-arg=--bridge-remote-debugging-port=9222",
|
|
72
|
+
"--chrome-arg=--bridge-debug-file=/tmp/wsl-chrome-bridge-debug.log",
|
|
73
|
+
"--no-sandbox"
|
|
74
|
+
]
|
|
75
|
+
enabled = true
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
In this example, Windows Chrome is launched with port `9222`, and `wsl-chrome-bridge` relays traffic between Windows Chrome and `chrome-devtools-mcp`.
|
|
79
|
+
|
|
80
|
+
> See the FAQ for how to locate `--executablePath`.
|
|
81
|
+
|
|
82
|
+
## Development Stack
|
|
83
|
+
|
|
84
|
+
- Node 24
|
|
85
|
+
- TypeScript v6
|
|
86
|
+
- Commander v14
|
|
87
|
+
- ws v8.20
|
|
88
|
+
- Test framework: Vitest v4.1
|
|
89
|
+
|
|
90
|
+
## Build
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install
|
|
94
|
+
npm run build
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Local Tests
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm test
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Test layers:
|
|
104
|
+
|
|
105
|
+
- Unit tests: path conversion, argument normalization, bridge launch planning
|
|
106
|
+
- Scenario tests: CLI argument passing integration into bridge runner
|
|
107
|
+
|
|
108
|
+
## FAQ
|
|
109
|
+
|
|
110
|
+
### How to find `--executablePath`
|
|
111
|
+
|
|
112
|
+
`chrome-devtools-mcp` expects `--executablePath` to be a file path, not just a command name (for example `wsl-chrome-bridge`).
|
|
113
|
+
|
|
114
|
+
#### Scenario A: No Node version manager (system Node only)
|
|
115
|
+
|
|
116
|
+
Use `command` to locate the absolute path:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
command -v wsl-chrome-bridge
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Then paste that output into `--executablePath`.
|
|
123
|
+
|
|
124
|
+
#### Scenario B: Using mise for multiple Node versions (recommended)
|
|
125
|
+
|
|
126
|
+
If you use mise and switch Node versions, do not hardcode a versioned path from `command -v` (for example `.../installs/node/<version>/bin/...`).
|
|
127
|
+
|
|
128
|
+
Prefer the mise shim entry:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
echo $HOME/.local/share/mise/shims/wsl-chrome-bridge
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Or inspect it directly:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
ls -la ~/.local/share/mise/shims/wsl-chrome-bridge
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### Summary
|
|
141
|
+
|
|
142
|
+
- Without a version manager, `command -v` is a direct and valid way to get an absolute path.
|
|
143
|
+
- With mise multi-version Node, prefer `/home/<user>/.local/share/mise/shims/wsl-chrome-bridge` so path does not break when Node versions change.
|
|
144
|
+
|
|
145
|
+
### Why `--user-data-dir` is not recommended
|
|
146
|
+
|
|
147
|
+
`chrome-devtools-mcp` checks whether `--user-data-dir` is an absolute path (starts with `/`). If not, it may be treated as relative, which does not work well with `%TEMP%\\...` style values. Use `--chrome-arg=--user-data-dir=...` instead.
|
|
148
|
+
|
|
149
|
+
## Important Argument Notes
|
|
150
|
+
|
|
151
|
+
- `--user-data-dir`: this original `chrome-devtools-mcp` option is not recommended here. It may pass an unexpected path and should be avoided.
|
|
152
|
+
- `--chrome-arg=--user-data-dir=...`: set Chrome profile path.
|
|
153
|
+
- `--chrome-arg=--bridge-chrome-executablePath=...`: optionally set the Chrome executable absolute path (Windows format required, for example `C:\\...`).
|
|
154
|
+
- `--chrome-arg=--bridge-remote-debugging-port=9222`: optionally set the Windows Chrome debug port. Default is `9222` if omitted. This is a bridge-only argument, not a native Chrome flag.
|
|
155
|
+
- `--chrome-arg=--bridge-debug-file=/tmp/xxx.log`: optional debug output file in WSL.
|
|
156
|
+
|
|
157
|
+
### Known incompatible original arguments
|
|
158
|
+
|
|
159
|
+
The following original `chrome-devtools-mcp` options are currently known as incompatible in this bridge setup:
|
|
160
|
+
|
|
161
|
+
- `--user-data-dir`: internal handling in `chrome-devtools-mcp` may turn an intended Windows-style path into Linux-style behavior, so this option is filtered out by this bridge and is not recommended for profile path configuration.
|
|
162
|
+
- `--browser-url`: this enables remote-connection mode in `chrome-devtools-mcp` instead of pipe mode, so it cannot work with `wsl-chrome-bridge`. Use `--chrome-arg=--bridge-remote-debugging-port=...` instead.
|
|
163
|
+
|
|
164
|
+
> Other original `chrome-devtools-mcp` arguments are not all fully validated yet. This project is still under development, so only currently tested limitations are listed here.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { toWindowsPathIfNeeded } from "./path-utils.js";
|
|
2
|
+
const PATH_FLAGS = new Set([
|
|
3
|
+
"--crash-dumps-dir",
|
|
4
|
+
"--disk-cache-dir"
|
|
5
|
+
]);
|
|
6
|
+
export function normalizeChromeArgs(args, options = {}) {
|
|
7
|
+
const normalized = [];
|
|
8
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
9
|
+
const arg = args[index];
|
|
10
|
+
const equalIndex = arg.indexOf("=");
|
|
11
|
+
if (equalIndex > -1) {
|
|
12
|
+
const flag = arg.slice(0, equalIndex);
|
|
13
|
+
const value = arg.slice(equalIndex + 1);
|
|
14
|
+
if (PATH_FLAGS.has(flag)) {
|
|
15
|
+
normalized.push(`${flag}=${toWindowsPathIfNeeded(value, {
|
|
16
|
+
distroName: options.distroName,
|
|
17
|
+
preferWslpath: options.preferWslpath,
|
|
18
|
+
wslpathConverter: options.wslpathConverter
|
|
19
|
+
})}`);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (PATH_FLAGS.has(arg) && index + 1 < args.length) {
|
|
24
|
+
normalized.push(arg);
|
|
25
|
+
normalized.push(toWindowsPathIfNeeded(args[index + 1], {
|
|
26
|
+
distroName: options.distroName,
|
|
27
|
+
preferWslpath: options.preferWslpath,
|
|
28
|
+
wslpathConverter: options.wslpathConverter
|
|
29
|
+
}) ?? "");
|
|
30
|
+
index += 1;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
normalized.push(arg);
|
|
34
|
+
}
|
|
35
|
+
return normalized;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=arg-normalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arg-normalizer.js","sourceRoot":"","sources":["../src/arg-normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,mBAAmB;IACnB,kBAAkB;CACnB,CAAC,CAAC;AAQH,MAAM,UAAU,mBAAmB,CACjC,IAAc,EACd,UAAmC,EAAE;IAErC,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CA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ridgeLaunchPlan {
|
|
2
|
+
originalArgs: string[];
|
|
3
|
+
passthroughArgs: string[];
|
|
4
|
+
bridgeDebugFile: string | null;
|
|
5
|
+
bridgeChromeExecutablePath: string | null;
|
|
6
|
+
userDataDir: string;
|
|
7
|
+
windowsUserDataDir: string;
|
|
8
|
+
requestedLocalDebugPort: number;
|
|
9
|
+
windowsDebugPort: number;
|
|
10
|
+
createdUserDataDir: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function planBridgeLaunch(chromeArgs: string[]): BridgeLaunchPlan;
|
|
13
|
+
export declare function buildWindowsChromeArgs(plan: BridgeLaunchPlan, env?: NodeJS.ProcessEnv): string[];
|
|
14
|
+
export declare function parseBrowserPathFromWsUrl(wsUrl: string): string;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { mkdtempSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { normalizeChromeArgs } from "./arg-normalizer.js";
|
|
5
|
+
const BRIDGE_CHROME_EXECUTABLE_FLAGS = [
|
|
6
|
+
"--bridge-chrome-executablePath",
|
|
7
|
+
"--bridge-chrome-executable-path"
|
|
8
|
+
];
|
|
9
|
+
const BRIDGE_REMOTE_DEBUGGING_PORT_FLAGS = [
|
|
10
|
+
"--bridge-remote-debugging-port",
|
|
11
|
+
"--bridge-remote-debuggingPort"
|
|
12
|
+
];
|
|
13
|
+
const DEFAULT_WINDOWS_USER_DATA_DIR = "%TEMP%\\wsl-chrome-bridge\\chrome-profile";
|
|
14
|
+
function isWindowsPath(value) {
|
|
15
|
+
return (/^[a-zA-Z]:[\\/]/.test(value) ||
|
|
16
|
+
value.startsWith("\\\\") ||
|
|
17
|
+
value.startsWith("%"));
|
|
18
|
+
}
|
|
19
|
+
function readFlagValue(args, index) {
|
|
20
|
+
if (index + 1 >= args.length) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return args[index + 1];
|
|
24
|
+
}
|
|
25
|
+
function parsePortOrThrow(value, source, allowMissing = false) {
|
|
26
|
+
if (value === undefined || value.trim() === "") {
|
|
27
|
+
if (allowMissing) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
throw new Error(`[wsl-chrome-bridge] missing value for ${source}. Please provide a port between 1 and 65535.`);
|
|
31
|
+
}
|
|
32
|
+
const parsed = Number.parseInt(value, 10);
|
|
33
|
+
if (!Number.isFinite(parsed) || parsed < 1 || parsed > 65535) {
|
|
34
|
+
throw new Error(`[wsl-chrome-bridge] invalid ${source}: "${value}". Port must be between 1 and 65535.`);
|
|
35
|
+
}
|
|
36
|
+
return parsed;
|
|
37
|
+
}
|
|
38
|
+
function normalizeWindowsUserDataDir(value) {
|
|
39
|
+
if (value.startsWith("/")) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
return value.replaceAll("/", "\\");
|
|
43
|
+
}
|
|
44
|
+
export function planBridgeLaunch(chromeArgs) {
|
|
45
|
+
const passthroughArgs = [];
|
|
46
|
+
let userDataDir = null;
|
|
47
|
+
let windowsUserDataDir = null;
|
|
48
|
+
let bridgeDebugFile = null;
|
|
49
|
+
let bridgeChromeExecutablePath = null;
|
|
50
|
+
let bridgeRemoteDebugPort = null;
|
|
51
|
+
let requestedLocalDebugPort = null;
|
|
52
|
+
for (let i = 0; i < chromeArgs.length; i += 1) {
|
|
53
|
+
const arg = chromeArgs[i];
|
|
54
|
+
if (arg === "--remote-debugging-pipe") {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (arg.startsWith("--remote-debugging-port=")) {
|
|
58
|
+
requestedLocalDebugPort = parsePortOrThrow(arg.split("=").slice(1).join("="), "--remote-debugging-port");
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (arg === "--remote-debugging-port") {
|
|
62
|
+
requestedLocalDebugPort = parsePortOrThrow(readFlagValue(chromeArgs, i), "--remote-debugging-port");
|
|
63
|
+
i += 1;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (arg.startsWith("--remote-debugging-address=") || arg === "--remote-debugging-address") {
|
|
67
|
+
if (arg === "--remote-debugging-address") {
|
|
68
|
+
i += 1;
|
|
69
|
+
}
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (arg.startsWith("--bridge-debug-file=")) {
|
|
73
|
+
bridgeDebugFile = arg.split("=").slice(1).join("=");
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (arg === "--bridge-debug-file") {
|
|
77
|
+
const value = readFlagValue(chromeArgs, i);
|
|
78
|
+
if (value) {
|
|
79
|
+
bridgeDebugFile = value;
|
|
80
|
+
i += 1;
|
|
81
|
+
}
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const bridgeChromeExecutableFlag = BRIDGE_CHROME_EXECUTABLE_FLAGS.find((flag) => arg === flag || arg.startsWith(`${flag}=`));
|
|
85
|
+
if (bridgeChromeExecutableFlag) {
|
|
86
|
+
if (arg === bridgeChromeExecutableFlag) {
|
|
87
|
+
const value = readFlagValue(chromeArgs, i);
|
|
88
|
+
if (value) {
|
|
89
|
+
bridgeChromeExecutablePath = value;
|
|
90
|
+
i += 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
bridgeChromeExecutablePath = arg.split("=").slice(1).join("=");
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const bridgeRemoteDebugPortFlag = BRIDGE_REMOTE_DEBUGGING_PORT_FLAGS.find((flag) => arg === flag || arg.startsWith(`${flag}=`));
|
|
99
|
+
if (bridgeRemoteDebugPortFlag) {
|
|
100
|
+
if (arg === bridgeRemoteDebugPortFlag) {
|
|
101
|
+
bridgeRemoteDebugPort = parsePortOrThrow(readFlagValue(chromeArgs, i), bridgeRemoteDebugPortFlag);
|
|
102
|
+
i += 1;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
bridgeRemoteDebugPort = parsePortOrThrow(arg.split("=").slice(1).join("="), bridgeRemoteDebugPortFlag);
|
|
106
|
+
}
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (arg.startsWith("--user-data-dir=")) {
|
|
110
|
+
const value = arg.split("=").slice(1).join("=");
|
|
111
|
+
if (isWindowsPath(value)) {
|
|
112
|
+
userDataDir = value;
|
|
113
|
+
windowsUserDataDir = value;
|
|
114
|
+
passthroughArgs.push(arg);
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (arg === "--user-data-dir") {
|
|
119
|
+
const value = readFlagValue(chromeArgs, i);
|
|
120
|
+
if (value) {
|
|
121
|
+
if (isWindowsPath(value)) {
|
|
122
|
+
userDataDir = value;
|
|
123
|
+
windowsUserDataDir = value;
|
|
124
|
+
passthroughArgs.push(arg, value);
|
|
125
|
+
}
|
|
126
|
+
i += 1;
|
|
127
|
+
}
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (arg.startsWith("--userDataDir=")) {
|
|
131
|
+
const value = arg.split("=").slice(1).join("=");
|
|
132
|
+
if (isWindowsPath(value)) {
|
|
133
|
+
userDataDir = value;
|
|
134
|
+
windowsUserDataDir = value;
|
|
135
|
+
passthroughArgs.push(arg);
|
|
136
|
+
}
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (arg === "--userDataDir") {
|
|
140
|
+
const value = readFlagValue(chromeArgs, i);
|
|
141
|
+
if (value) {
|
|
142
|
+
if (isWindowsPath(value)) {
|
|
143
|
+
userDataDir = value;
|
|
144
|
+
windowsUserDataDir = value;
|
|
145
|
+
passthroughArgs.push(arg, value);
|
|
146
|
+
}
|
|
147
|
+
i += 1;
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
passthroughArgs.push(arg);
|
|
152
|
+
}
|
|
153
|
+
let createdUserDataDir = false;
|
|
154
|
+
if (!userDataDir) {
|
|
155
|
+
userDataDir = mkdtempSync(join(tmpdir(), "wsl-chrome-bridge-profile-"));
|
|
156
|
+
createdUserDataDir = true;
|
|
157
|
+
passthroughArgs.push(`--user-data-dir=${userDataDir}`);
|
|
158
|
+
}
|
|
159
|
+
if (!windowsUserDataDir) {
|
|
160
|
+
windowsUserDataDir = DEFAULT_WINDOWS_USER_DATA_DIR;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
windowsUserDataDir = normalizeWindowsUserDataDir(windowsUserDataDir);
|
|
164
|
+
}
|
|
165
|
+
if (requestedLocalDebugPort === null) {
|
|
166
|
+
requestedLocalDebugPort = 9222;
|
|
167
|
+
}
|
|
168
|
+
const windowsDebugPort = bridgeRemoteDebugPort ?? requestedLocalDebugPort;
|
|
169
|
+
return {
|
|
170
|
+
originalArgs: [...chromeArgs],
|
|
171
|
+
passthroughArgs,
|
|
172
|
+
bridgeDebugFile,
|
|
173
|
+
bridgeChromeExecutablePath,
|
|
174
|
+
userDataDir,
|
|
175
|
+
windowsUserDataDir,
|
|
176
|
+
requestedLocalDebugPort,
|
|
177
|
+
windowsDebugPort,
|
|
178
|
+
createdUserDataDir
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export function buildWindowsChromeArgs(plan, env = process.env) {
|
|
182
|
+
const withoutUserDataDir = plan.passthroughArgs.filter((arg, index, args) => {
|
|
183
|
+
if (arg === "--user-data-dir" || arg === "--userDataDir") {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (index > 0 && (args[index - 1] === "--user-data-dir" || args[index - 1] === "--userDataDir")) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (arg.startsWith("--user-data-dir=") || arg.startsWith("--userDataDir=")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return true;
|
|
193
|
+
});
|
|
194
|
+
const normalized = normalizeChromeArgs(withoutUserDataDir, {
|
|
195
|
+
distroName: env.WSL_DISTRO_NAME
|
|
196
|
+
});
|
|
197
|
+
const withoutRemoteAllowOrigins = normalized.filter((arg) => !arg.startsWith("--remote-allow-origins"));
|
|
198
|
+
return [
|
|
199
|
+
`--user-data-dir=${plan.windowsUserDataDir}`,
|
|
200
|
+
`--remote-debugging-port=${plan.windowsDebugPort}`,
|
|
201
|
+
"--remote-debugging-address=127.0.0.1",
|
|
202
|
+
"--remote-allow-origins=*",
|
|
203
|
+
...withoutRemoteAllowOrigins
|
|
204
|
+
];
|
|
205
|
+
}
|
|
206
|
+
export function parseBrowserPathFromWsUrl(wsUrl) {
|
|
207
|
+
const parsed = new URL(wsUrl);
|
|
208
|
+
return parsed.pathname + parsed.search;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=bridge-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-options.js","sourceRoot":"","sources":["../src/bridge-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAc1D,MAAM,8BAA8B,GAAG;IACrC,gCAAgC;IAChC,iCAAiC;CAClC,CAAC;AACF,MAAM,kCAAkC,GAAG;IACzC,gCAAgC;IAChC,+BAA+B;CAChC,CAAC;AACF,MAAM,6BAA6B,GAAG,2CAA2C,CAAC;AAElF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,CACL,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC7B,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;QACxB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CACtB,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,IAAc,EAAE,KAAa;IAClD,IAAI,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC7B,OAAO,S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