mcp-browser-dev-tools 0.0.1-beta.1 → 0.0.1-beta.11
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 +260 -13
- package/package.json +4 -1
- package/src/browser-adapter.mjs +275 -0
- package/src/browser-launcher.mjs +35 -0
- package/src/cdp-client.mjs +526 -85
- package/src/cli.mjs +212 -9
- package/src/config.mjs +24 -9
- package/src/doctor.mjs +25 -5
- package/src/firefox-bidi-client.mjs +509 -100
- package/src/index.mjs +13 -1
- package/src/json-rpc-stdio.mjs +130 -21
- package/src/mcp-server.mjs +360 -5
- package/src/page-context.mjs +734 -0
- package/src/session-events.mjs +16 -2
- package/src/tcp-relay.mjs +194 -0
package/src/browser-launcher.mjs
CHANGED
|
@@ -37,6 +37,36 @@ export function getBrowserCandidates(
|
|
|
37
37
|
env = process.env,
|
|
38
38
|
platform = detectPlatform(env),
|
|
39
39
|
) {
|
|
40
|
+
if (family === "edge") {
|
|
41
|
+
if (platform === "darwin") {
|
|
42
|
+
return [
|
|
43
|
+
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
|
|
44
|
+
"microsoft-edge",
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (platform === "wsl") {
|
|
49
|
+
return [
|
|
50
|
+
"microsoft-edge",
|
|
51
|
+
"microsoft-edge-stable",
|
|
52
|
+
"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe",
|
|
53
|
+
"/mnt/c/Program Files/Microsoft/Edge/Application/msedge.exe",
|
|
54
|
+
"msedge.exe",
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (platform === "win32") {
|
|
59
|
+
return [
|
|
60
|
+
"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
|
|
61
|
+
"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
|
|
62
|
+
"msedge.exe",
|
|
63
|
+
"microsoft-edge",
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return ["microsoft-edge", "microsoft-edge-stable", "msedge"];
|
|
68
|
+
}
|
|
69
|
+
|
|
40
70
|
if (family === "firefox") {
|
|
41
71
|
if (platform === "darwin") {
|
|
42
72
|
return ["/Applications/Firefox.app/Contents/MacOS/firefox", "firefox"];
|
|
@@ -128,10 +158,12 @@ export async function findBrowserExecutable(family, env = process.env) {
|
|
|
128
158
|
|
|
129
159
|
export async function detectInstalledBrowsers(env = process.env) {
|
|
130
160
|
const chromium = await findBrowserExecutable("chromium", env);
|
|
161
|
+
const edge = await findBrowserExecutable("edge", env);
|
|
131
162
|
const firefox = await findBrowserExecutable("firefox", env);
|
|
132
163
|
|
|
133
164
|
return {
|
|
134
165
|
chromium,
|
|
166
|
+
edge,
|
|
135
167
|
firefox,
|
|
136
168
|
};
|
|
137
169
|
}
|
|
@@ -149,6 +181,9 @@ export function buildBrowserLaunchArgs({
|
|
|
149
181
|
|
|
150
182
|
const args = [];
|
|
151
183
|
if (family === "firefox") {
|
|
184
|
+
if (userDataDir) {
|
|
185
|
+
args.push("-new-instance", "-profile", userDataDir);
|
|
186
|
+
}
|
|
152
187
|
if (remoteDebuggingPort) {
|
|
153
188
|
args.push(`--remote-debugging-port=${remoteDebuggingPort}`);
|
|
154
189
|
}
|