browser-devtools-mcp 0.4.1 → 0.4.3
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/package.json +1 -1
- package/postinstall.cjs +8 -4
package/package.json
CHANGED
package/postinstall.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - BROWSER_DEVTOOLS_INSTALL_FIREFOX=true → firefox
|
|
8
8
|
* - BROWSER_DEVTOOLS_INSTALL_WEBKIT=true → webkit
|
|
9
9
|
* If none are set, we do nothing; Playwright's own install scripts behave as usual.
|
|
10
|
-
*
|
|
10
|
+
* Does not fail npm install on error.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
const CHROMIUM_BROWSERS = ['chromium', 'chromium-headless-shell', 'ffmpeg'];
|
|
@@ -21,9 +21,6 @@ function envTruthy(name) {
|
|
|
21
21
|
|
|
22
22
|
/** Returns list of browser names to install based on env vars only. */
|
|
23
23
|
function getBrowsersToInstall() {
|
|
24
|
-
if (envTruthy('PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD')) {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
24
|
const list = [];
|
|
28
25
|
if (envTruthy('BROWSER_DEVTOOLS_INSTALL_CHROMIUM')) {
|
|
29
26
|
list.push(...CHROMIUM_BROWSERS);
|
|
@@ -46,7 +43,14 @@ async function main() {
|
|
|
46
43
|
try {
|
|
47
44
|
const { installBrowsersForNpmInstall } = require('playwright-core/lib/server');
|
|
48
45
|
console.log(`[browser-devtools-mcp] Installing browser binaries: ${toInstall} ...`);
|
|
46
|
+
const hadSkip = process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD;
|
|
47
|
+
if (hadSkip !== undefined) {
|
|
48
|
+
delete process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD;
|
|
49
|
+
}
|
|
49
50
|
await installBrowsersForNpmInstall(toInstall);
|
|
51
|
+
if (hadSkip !== undefined) {
|
|
52
|
+
process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = hadSkip;
|
|
53
|
+
}
|
|
50
54
|
console.log(`[browser-devtools-mcp] Installed browser binaries: ${toInstall} `);
|
|
51
55
|
} catch (e) {
|
|
52
56
|
console.warn('[browser-devtools-mcp] Could not auto-install Playwright browsers:', e && e.message ? e.message : e);
|