Operations 13 min read

How to Let Claude Code Control Chrome: Skip Login, Auto‑Fill Backend Data, and Solve Captchas Visually

This article walks through using Claude Code with Microsoft Playwright MCP to hijack the local Chrome browser, covering version requirements, the two connection modes, token configuration, real‑world tests for auto‑login, captcha solving, form queries, navigation pitfalls, security risks, and practical recommendations.

Tech Ocean
Tech Ocean
Tech Ocean
How to Let Claude Code Control Chrome: Skip Login, Auto‑Fill Backend Data, and Solve Captchas Visually

1. Official Claude‑in‑Chrome Extension – Prerequisites

Anthropic provides a Chrome extension that lets Claude Code open a new tab in the real Chrome instance using claude --chrome or /chrome. It works only with an official Pro/Max/Team/Enterprise subscription; API keys or third‑party providers such as Bedrock are not supported.

Supported versions: Claude Code ≥ 2.1.216, Chrome / Edge, extension ≥ 1.0.36.

Authentication must be a direct official subscription; other tokens are ignored.

Even with a valid subscription, the beta feature may fail to connect.

2. Playwright MCP – Two Connection Modes

Playwright MCP can be launched with a single command: npx @playwright/mcp@latest By default it creates a brand‑new isolated browser profile, which does not share the existing Chrome login state. To reuse the real Chrome profile, the --extension mode is required.

Install the Playwright Extension from the Chrome Web Store.

Add the --extension flag to the MCP command.

Configure MCP with a JSON block that includes the --extension argument and the extension token.

Restart the Claude Code session so MCP loads the new configuration.

If the token is missing, the extension shows “No clients are currently connected”. The token is displayed in the extension popup as PLAYWRIGHT_MCP_EXTENSION_TOKEN and must be copied into the MCP env section.

3. Test 1 – Automatic Login and Captcha Solving

Using the public JeecgBoot demo (account jeecg/jeecg#123456), the --extension mode reuses the saved Chrome password, so the login fields are auto‑filled. The captcha image, invisible to Claude’s DOM snapshot, is captured, OCR‑read, and the correct text is entered, resulting in a successful login for both numeric and alphanumeric captchas.

Login page test: auto‑fill + image‑based captcha
Login page test: auto‑fill + image‑based captcha

Note: the demo’s captcha is simple; more sophisticated challenges may fail.

4. Test 2 – Form Query and Result Verification

After logging in, the “System Users” list can be filtered by account, name, and gender. Using Claude’s snapshot, the script calls fill_form to populate the account field and clicks “Search”. The resulting table contains five rows, with a single record matching the filter (admin). The same approach works for the “Process Designer” list (45 rows, 10 per page), allowing full structured extraction without manual navigation.

Form query test: 5 rows filtered to 1 admin record
Form query test: 5 rows filtered to 1 admin record

This pattern—structured snapshot → fill → verify—is a high‑frequency, low‑error scenario for agents.

5. Test 3 – Navigation Pitfalls

The top‑level “More” menu (icon ...) expands to items without accessible names. Clicking “System Management” reports success but actually opens “Process Designer” because the click lands on a neighboring unnamed menu item. No error is raised, so visual confirmation is required.

Click mis‑direction: target System Management, opened Process Designer
Click mis‑direction: target System Management, opened Process Designer

✅ Verify the landing page (title or screenshot) after each click; tool‑reported success is insufficient.

✅ For icon‑only items, use screenshots to locate the element rather than guessing coordinates.

✅ Confirm “New” or “Add” actions before execution to avoid creating test data.

6. Common Pitfalls and Countermeasures

--extension

configured but not connected → extension shows “No clients are currently connected”; copy the token from the popup into the MCP env.

Configuration changes not taking effect → restart the Claude Code session because MCP loads only at startup.

Click reports success but lands on the wrong page → always capture a screenshot or read the page title after the click.

Menu items lack accessible names → rely on visual cues and re‑capture screenshots when guessing.

7. Security Considerations

When using --extension, the agent gains full access to the browser’s login state, including email, banking, and internal systems.

Disconnect the extension when not in use.

Avoid navigating to unrelated sensitive sites during tasks; require explicit confirmation for privileged actions.

Treat PLAYWRIGHT_MCP_EXTENSION_TOKEN as a secret; exclude it from version control via .gitignore.

A reported vulnerability (Manifold Security, May 2026) showed that a malicious extension could forge clicks in the same browser, though the default “ask before acting” mode still prompts for confirmation. Silent execution is only possible when the “no‑confirm” mode is enabled, so review permissions carefully before granting access.

8. Final Thoughts

Letting Claude Code control the real Chrome can automate backend data retrieval, form verification, and screenshot capture without manual browsing. The only non‑trivial step is copying the extension token; the rest follows the documented commands.

Related Links

Playwright MCP repository: https://github.com/microsoft/playwright-mcp

Playwright Extension (Chrome Web Store): https://chromewebstore.google.com/detail/playwright-extension/mmlmfjhmonkocbjadbfplnigmagldckm

Claude Code documentation: https://code.claude.com/docs/en/chrome

Security research (The Hacker News): https://thehackernews.com/2026/07/claude-for-chrome-flaw-lets-other.html

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

SecurityBrowser extensionChrome automationClaude CodeCaptcha solvingPlaywright MCP
Tech Ocean
Written by

Tech Ocean

Focused on AI programming, sharing ready-to-use development efficiency solutions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.