resize_page fails with Protocol error: Browser.setContentsSize wasn't found
Description
When calling resize_page to test mobile viewports, the command fails with a protocol error.
Error Message
Protocol error (Browser.setContentsSize): 'Browser.setContentsSize' wasn't found
Environment
- Chrome DevTools MCP version: Latest (installed via Claude Code)
- Chrome version: Unknown (remote debugging)
- Platform: Linux (WSL2)
- Claude Code: CLI
Steps to Reproduce
- Navigate to any page using
navigate_page - Call
resize_pagewith mobile dimensions:
resize_page(width=414, height=896)
- Observe protocol error
Expected Behavior
Page viewport should resize to specified dimensions for mobile testing.
Actual Behavior
Command fails with Browser.setContentsSize not found error.
Workaround
Currently using emulate for CPU/network throttling, but cannot test mobile viewport sizes.
Additional Context
This appears to be a Chrome DevTools Protocol compatibility issue - Browser.setContentsSize may not be available in all Chrome versions or may have been deprecated.
Filed from Claude Code session
Could you please provide the Chrome version you are using?
Thanks for the quick response, @OrKoN!
Chrome Version:
Google Chrome 139.0.7258.138 (running via remote debugging on Linux/WSL2)
Additional Context:
I see PR #650 addresses this by switching from Browser.setContentsSize to page.setViewport - that's exactly what's needed! The Browser.setContentsSize method appears to be unavailable in Chrome 139, which aligns with the protocol error.
Environment Details:
- OS: Linux (WSL2) -
Linux 6.6.87.2-microsoft-standard-WSL2 - Chrome Version: 139.0.7258.138
- Interface: Claude Code CLI
- Chrome DevTools MCP: Latest version (as of Dec 5, 2025)
- Remote Debugging: Yes (Chrome launched with
--remote-debugging-port)
Workaround (Temporary):
Until PR #650 is merged, I've been using the emulate function for basic mobile viewport testing, though it's not as clean as a dedicated resize_page function.
Testing Offer: Once PR #650 is merged, I'm happy to test the fix in my environment (WSL2 + remote debugging) to confirm it resolves the issue.
Thanks for the quick turnaround on this! 🙏
Update: I see PR #650 was closed without merging, as you prefer to keep using resize to avoid viewport/window size mismatches.
Given that Browser.setContentsSize appears to be unavailable in Chrome 139 (and possibly other versions), what would be the recommended approach to fix this?
Potential solutions:
- Feature detection: Check if
Browser.setContentsSizeis available before calling it, and provide a helpful error message if not - Alternative CDP method: Is there a different Chrome DevTools Protocol method that achieves the same window resizing without the viewport rendering issues?
- Chrome version requirements: Should the tool document minimum/maximum Chrome versions where
resize_pageis expected to work?
Happy to help test any proposed solutions in my Chrome 139 + WSL2 environment. Let me know how you'd like to proceed!
Per https://github.com/ChromeDevTools/chrome-devtools-mcp we support only the current stable Chrome version which is Chrome 143 so I would recommend upgrading to a supported version.