chrome-devtools-mcp-for-extension 0.9.9 → 0.9.10
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/build/src/browser.js +13 -1
- package/package.json +1 -1
package/build/src/browser.js
CHANGED
|
@@ -336,6 +336,13 @@ export async function launch(options) {
|
|
|
336
336
|
console.error(` Args: ${JSON.stringify(args, null, 2)}`);
|
|
337
337
|
console.error(` Ignored Default Args: ["--disable-extensions", "--enable-automation"]`);
|
|
338
338
|
try {
|
|
339
|
+
// IMPORTANT: Chrome extensions (especially MV3 content scripts and service workers)
|
|
340
|
+
// DO NOT work in headless mode. Always use headless:false when loading extensions.
|
|
341
|
+
// Reference: https://groups.google.com/a/chromium.org/g/headless-dev/c/nEoeUkoNI0o/m/9KZ4Os46AQAJ
|
|
342
|
+
const effectiveHeadless = extensionPaths.length > 0 ? false : headless;
|
|
343
|
+
if (extensionPaths.length > 0 && headless) {
|
|
344
|
+
console.warn('⚠️ WARNING: Extensions require headful mode. Forcing headless:false');
|
|
345
|
+
}
|
|
339
346
|
const browser = await puppeteer.launch({
|
|
340
347
|
...connectOptions,
|
|
341
348
|
channel: puppeterChannel,
|
|
@@ -343,9 +350,14 @@ export async function launch(options) {
|
|
|
343
350
|
defaultViewport: null,
|
|
344
351
|
userDataDir,
|
|
345
352
|
pipe: true,
|
|
346
|
-
headless,
|
|
353
|
+
headless: effectiveHeadless,
|
|
347
354
|
args,
|
|
348
355
|
ignoreDefaultArgs: ['--disable-extensions', '--enable-automation'],
|
|
356
|
+
// enableExtensions: Provide unpacked extension folder paths
|
|
357
|
+
// These paths can point to System Chrome's extension directories
|
|
358
|
+
// (e.g., ~/Library/.../Chrome/Default/Extensions/<id>/<version>/)
|
|
359
|
+
// No need to copy extensions to CfT profile
|
|
360
|
+
// Reference: https://pptr.dev/guides/chrome-extensions
|
|
349
361
|
enableExtensions: extensionPaths.length > 0 ? extensionPaths : undefined,
|
|
350
362
|
});
|
|
351
363
|
// Log actual spawn args for debugging
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.10",
|
|
4
4
|
"description": "MCP server for Chrome extension development with Web Store automation. Fork of chrome-devtools-mcp with extension-specific tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./build/src/index.js",
|