Chrome DevTools for coding agents
docs: clarify scope of --no-javascript-evaluation (#3100)
Alex Rudenko0c67cd5cd90b
diff --git a/SECURITY.md b/SECURITY.mdindex 56044db7..98b5a174 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -28,3 +28,11 @@ filesystem sandboxing, we recommend using OS sandbox mechanisms.Optional `--allowed-url-pattern` and `--blocked-url-pattern` arguments configure the **browser** to reject access to the identified URLs. Note that this is not a complete network sandbox and it only applies to Chrome DevTools targets while `chrome-devtools-mcp` is attached to them.To have a full network sandbox, we recommend using a separate OS/VM sandbox mechanism.++### JavaScript evaluation++The optional `--no-javascript-evaluation` argument disables specific server entry points for evaluating caller-provided JavaScript: the `evaluate_script` tool (and the slim `evaluate` tool), the `initScript` parameter of `navigate_page`, and navigations to `javascript:`, `data:`, or `vbscript:` URLs. It is not a JavaScript sandbox and does not create a browser-wide execution boundary. Scripts owned by the page, and JavaScript triggered through otherwise permitted browser interactions (for example, clicking or typing), still run.++The `--experimentalDevtools` argument enables automation of DevTools targets, including the DevTools Console, which can evaluate caller-entered JavaScript in the inspected page. `--no-javascript-evaluation` does not restrict this UI path. If both options are configured together, input tools can still cause JavaScript to be evaluated in the inspected page through DevTools. Omitting `--experimentalDevtools` removes this particular path, but does not provide complete JavaScript confinement.++As with other tools, the client is responsible for validating tool calls and parameters before sending them.diff --git a/docs/configuration.md b/docs/configuration.mdindex b1539b1d..a3d93498 100644--- a/docs/configuration.md+++ b/docs/configuration.md@@ -157,7 +157,7 @@ The Chrome DevTools MCP server supports the following configuration option:- **Default:** `true`- **`--experimentalDevtools`/ `--experimental-devtools`**- Whether to enable automation over DevTools targets+ Whether to enable automation over DevTools targets. This exposes the DevTools UI to input tools, including the Console, which can evaluate JavaScript in the inspected page. --no-javascript-evaluation does not restrict this path.- **Type:** boolean- **Default:** `false`@@ -205,7 +205,7 @@ The Chrome DevTools MCP server supports the following configuration option:- **Default:** `true`- **`--javascriptEvaluation`/ `--javascript-evaluation`**- Set to false to disable JavaScript execution. When disabled, evaluation tools (evaluate_script and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed.+ Set to false to disable the server entry points for evaluating caller-provided JavaScript: evaluation tools (evaluate_script and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed. This is not a JavaScript sandbox: page scripts and JavaScript triggered through other permitted browser interactions (e.g. clicks or typing) still run. If --experimentalDevtools is also enabled, the DevTools UI, including the Console that evaluates code in the inspected page, can be automated and is not restricted by this option. The client remains responsible for validating tool calls and parameters.- **Type:** boolean- **Default:** `true`diff --git a/src/config/mcp-options.ts b/src/config/mcp-options.tsindex 100e91a2..06df883b 100644--- a/src/config/mcp-options.ts+++ b/src/config/mcp-options.ts@@ -41,7 +41,8 @@ export const mcpOptions = {experimentalDevtools: {type: 'boolean',default: false,- describe: 'Whether to enable automation over DevTools targets',+ describe:+ 'Whether to enable automation over DevTools targets. This exposes the DevTools UI to input tools, including the Console, which can evaluate JavaScript in the inspected page. --no-javascript-evaluation does not restrict this path.',},experimentalVision: {type: 'boolean',@@ -129,7 +130,7 @@ export const mcpOptions = {type: 'boolean',default: true,describe:- 'Set to false to disable JavaScript execution. When disabled, evaluation tools (evaluate_script and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed.',+ 'Set to false to disable the server entry points for evaluating caller-provided JavaScript: evaluation tools (evaluate_script and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed. This is not a JavaScript sandbox: page scripts and JavaScript triggered through other permitted browser interactions (e.g. clicks or typing) still run. If --experimentalDevtools is also enabled, the DevTools UI, including the Console that evaluates code in the inspected page, can be automated and is not restricted by this option. The client remains responsible for validating tool calls and parameters.',},fileNavigations: {type: 'boolean',@@ -321,7 +322,7 @@ export const CLI_EXAMPLES: Array<[string, string]> = [['$0 --no-source-maps', 'Disable source maps in DevTools.'],['$0 --no-javascript-evaluation',- 'Disable JavaScript execution (disables evaluation tools, initScript in navigate_page, and navigating to javascript:, data:, or vbscript: URLs).',+ 'Disable server JavaScript evaluation entry points (evaluation tools, initScript in navigate_page, and navigating to javascript:, data:, or vbscript: URLs). Page scripts still run.',],['$0 --slim',