chrome-devtools-mcp icon indicating copy to clipboard operation
chrome-devtools-mcp copied to clipboard

Bug: Pages navigate but don't render content (blank/about:blank)

Open OcarCampos opened this issue 10 months ago • 2 comments

Bug: Pages navigate but don't render content (blank/about:blank)

Summary

When using chrome-devtools-mcp v0.13.0 via mcp-cli-ent, pages successfully navigate but fail to render content. The page URL shows as "about:blank", document.body.innerHTML is empty (length 0), and screenshots are blank (16KB). Manual Chrome headless on the same machine works perfectly.

Environment

  • MCP Server: chrome-devtools-mcp v0.13.0
  • Client: mcp-cli-ent
  • Platform: Linux (Fedora 43)
  • Chrome: Google Chrome 144.0.7559.96
  • Config:
{
  "command": "npx",
  "args": [
    "-y",
    "chrome-devtools-mcp@latest",
    "--isolated"
  ],
  "timeout": 60,
  "session": {},
  "persistent": true
}

Reproduction Steps

  1. Call navigate_page tool:
mcp-cli-ent call-tool chrome-devtools navigate_page '{"url": "https://www.wikipedia.org/"}'
  1. Returns success: "Successfully navigated to https://www.wikipedia.org/."
  2. Call evaluate_script to check page:
mcp-cli-ent call-tool chrome-devtools evaluate_script '{"function": "() => { return { url: window.location.href, bodyLength: document.body.innerHTML.length }; }"}'
  1. Returns: {"url":"about:blank","bodyLength":0}
  2. Take screenshot:
mcp-cli-ent call-tool chrome-devtools take_screenshot '{"filePath": "/tmp/test.png"}'
  1. Result: Blank screenshot (16KB)

Expected Behavior

  • Page should render content
  • window.location.href should show the actual URL
  • document.body.innerHTML should contain page content
  • Screenshot should show rendered page (typically >100KB for a full page)
  • wait_for tool should be able to find elements on the page

Actual Behavior

  • Page navigates but doesn't render content
  • URL shows as "about:blank" instead of actual URL
  • document.body.innerHTML length is 0
  • Screenshot is blank (16KB)
  • wait_for tool times out for any page content

Additional Testing Results

Test 1: Without --isolated flag

  • Config: Removed --isolated flag, added --headless
  • Result: navigate_page returns correct URL (https://example.com), but subsequent commands still fail with "browser already running" error
  • Conclusion: Same underlying issue - pages don't actually render

Test 2: Affected Sites

All tested sites exhibit the same behavior:

  • https://www.wikipedia.org/
  • https://www.jumbo.cl/
  • https://www.lider.cl/
  • https://www.turbus.cl/
  • https://example.com/

Test 3: Manual Chrome headless (Control)

Command:

google-chrome-stable --headless=new --disable-gpu --screenshot=/tmp/test.png --window-size=1920,1080 --virtual-time-budget=10000 https://www.wikipedia.org/

Result:

  • Wikipedia: 161KB screenshot, fully rendered ✅
  • Jumbo.cl: 84KB screenshot, fully rendered ✅
  • All content accessible and visible

Test 4: take_snapshot tool

mcp-cli-ent call-tool chrome-devtools take_snapshot '{"filePath": "/tmp/snapshot.html"}'

Result:

uid=1_0 RootWebArea url="about:blank"
  uid=1_1 ignored
    uid=1_2 ignored

Conclusion: Confirms page is at about:blank, not actual URL

Workaround

Manual Chrome headless works perfectly and bypasses the issue:

google-chrome-stable --headless=new --disable-gpu --screenshot=/tmp/test.png --virtual-time-budget=10000 https://www.wikipedia.org/

Impact

Critical: This bug prevents all interactive browser automation tasks:

  • Cannot fill forms (page doesn't render inputs)
  • Cannot click elements (elements don't exist in DOM)
  • Cannot read page content (DOM is empty)
  • Cannot perform multi-step workflows
  • Cannot test web applications

The MCP server reports success for navigation but provides no actual functionality for page interaction.

Additional Notes

  • The issue affects ALL tested sites, ruling out anti-bot protection as the cause
  • Manual Chrome headless confirms sites load correctly on this system
  • The navigate_page command returns "Successfully navigated" but the browser remains on about:blank
  • This appears to be a fundamental issue with how the MCP server connects to or controls Chrome
  • Tested with both --isolated and persistent profile - same result

Root Cause Hypothesis

The chrome-devtools-mcp server may be:

  1. Successfully launching Chrome
  2. Successfully sending navigation command via CDP (Chrome DevTools Protocol)
  3. But failing to properly wait for or verify page load completion
  4. The browser may navigate but the MCP server doesn't capture the result correctly
  5. Or the CDP connection may be attached to the wrong page context

Suggested Investigation

  1. Check if the MCP server is waiting for page load events correctly
  2. Verify the CDP target selection - may be attached to initial about:blank page instead of new page
  3. Add explicit wait/load verification after navigation
  4. Check for race condition between navigation and page load
  5. Consider adding a --debug or --verbose flag for troubleshooting

OcarCampos avatar Jan 25 '26 19:01 OcarCampos

Can you confirm that the CLI you are using is not terminating the server after each command? The MCP server is stateful and if it does terminate the server then what you are seeing is expected.

OrKoN avatar Jan 26 '26 12:01 OrKoN

Hi @OrKoN,

You were right to ask. I investigated and found the root cause:

Answer to Your Question

Yes, mcp-cli-ent IS terminating the server after each command.

Why This Happens

  1. mcp-cli-ent daemon tries to run on port 8080
  2. qBittorrent on my system is already using port 8080
  3. The daemon cannot start due to port conflict
  4. call-tool falls back to non-persistent mode (spawns chrome-devtools-mcp per command)
  5. Each command gets a fresh Chrome instance → about:blank

Test Results with Connect Mode

When I manually start Chrome and use --browserUrl connect mode:

  • Daemon still terminates per command, BUT
  • Chrome itself stays alive (running separately)
  • Browser state persists → pages render correctly

The Real Issue

This is not a chrome-devtools-mcp bug. It is a port conflict between:

  • mcp-cli-ent daemon (wants port 8080, hardcoded)
  • qBittorrent WebUI (using port 8080)

Without a persistent daemon, isolated mode cannot work because each command spawns a new isolated Chrome instance.


That said, we are using agent-browser now and it works well for us. I am sharing this in case it helps others, but we are unblocked.

Thanks for the pointer — it led to finding the root cause!

OcarCampos avatar Jan 26 '26 23:01 OcarCampos