Enable extension loading when --load-extension is provided
Use Case
We needed to test a browser extension using an AI assistant and chrome-devtools-mcp. The extension had RTL positioning fixes that required testing with actual form fields.
Current Behavior
When using --chromeArg="--load-extension=/path/to/extension", the extension doesn't load because chrome-devtools-mcp launches Chrome with --disable-extensions by default, which overrides the --load-extension flag.
Proposed Solution
When --load-extension is detected in Chrome arguments, automatically set enableExtensions: true instead of the default false.
Real-World Impact
This change would enable:
- Testing browser extensions during development
- AI-assisted debugging of extension functionality
- Automated extension testing workflows
Current Workaround
We had to patch the package locally (see this commit) which works but isn't ideal for distribution.
Implementation
Could check for --load-extension in the Chrome args and automatically enable extensions when detected, rather than requiring manual patching.
I believe --load-extension was removed from Chrome around M142 https://chromium.googlesource.com/chromium/src/+/290ed8046692651ce76088914750cb659b65fb17%5E%21/chrome/browser/extensions/extension_service.cc We do plan to have the support for extension debugging making this a duplicate of https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/96 I believe.
This worked for me: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/265#issuecomment-3621814641