Skip to content

Chrome DevTools for coding agents

fix(cli): forward explicit false options on start (#2702)

Julian Huangd9a8cb6ec22a
diff --git a/src/bin/chrome-devtools.ts b/src/bin/chrome-devtools.ts
index 07191831..a55e8f92 100644
--- a/src/bin/chrome-devtools.ts
+++ b/src/bin/chrome-devtools.ts
@@ -155,7 +155,7 @@ y.command(
) {
argv.headless = true;
}
- const args = serializeArgs(mcpOptions, argv);
+ const args = serializeArgs(getCliOptions(), argv);
await start(args, argv.sessionId);
process.exit(0);
},
diff --git a/tests/e2e/chrome-devtools-start-stop.test.ts b/tests/e2e/chrome-devtools-start-stop.test.ts
index b83b1ec2..fa3dc616 100644
--- a/tests/e2e/chrome-devtools-start-stop.test.ts
+++ b/tests/e2e/chrome-devtools-start-stop.test.ts
@@ -79,6 +79,22 @@ describe('chrome-devtools', () => {
await assertDaemonIsRunning(sessionId);
});
+ it('forwards an explicit headless=false option', async () => {
+ const startResult = await runCli(['start', '--headless=false'], sessionId);
+ assert.strictEqual(
+ startResult.status,
+ 0,
+ `start command failed: ${startResult.stderr}`,
+ );
+
+ const statusResult = await runCli(['status'], sessionId);
+ assert.strictEqual(statusResult.status, 0);
+ assert.ok(
+ statusResult.stdout.includes('--no-headless'),
+ `headless=false was not forwarded: ${statusResult.stdout}`,
+ );
+ });
+
it('can start the daemon with a workspace', async () => {
const workspace = fs.mkdtempSync(
path.join(os.tmpdir(), 'chrome-devtools-workspace-'),