Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Controlling Chrome Browser with Claude Code

Controlling Chrome Browser with Claude Code

Claude Code's Chrome integration lets you control the browser directly from the command line (CLI) or the VS Code extension. Claude can:

Core Advantages: Claude shares your browser's login state, with no need for extra API keys or re-authentication.

This feature is currently in Beta; it lets you use natural language instructions in the terminal (CLI) or VS Code to have Claude directly control your Chrome browser for navigation, clicking, typing, debugging, data extraction, and more, without manually switching windows.


Installation and preparation

Prerequisites

Before using this feature, you need to meet the following requirements:

Conditional Description
Claude Code version v2.0.73 or higher
Chrome extension version Claude in Chrome v1.0.36 or higher
Anthropic account NeededDirect paid plan(Pro, Max, Teams, or Enterprise)
Unsupported channels Users accessing via Amazon Bedrock, Google Vertex AI, or Microsoft FoundryUnusable

Installation Steps

1. Install the browser extension:

2. Install/update Claude Code:

3. Permissions and connection:


How to start and connect

Start in the CLI


in /chrome Select "Enabled by default" in the menu.

Using it in VS Code

Check connection status

Enter in a Claude Code session /chrometo view status, manage permissions, and reconnect the extension.


Basic Usage

Claude Code controls the browser throughnatural language prompts, with no need to write complex code. Claude automatically parses your instructions, performs the corresponding actions, and returns results (including screenshots, console logs, extracted data, etc.).

Core capability:

Prompt tips:


Practical Examples

Example 1: Simple navigation and interaction

去到 https://www.baidu.com,点击搜索框,输入 "python",告诉我出现的搜索结果。

Example 2: Local web page testing and debugging

我刚更新了登录表单验证。请打开 localhost:3000,用无效数据提交表单,检查错误消息是否正确显示,并查看控制台日志。

Example 3: Form automation (with local files)

我有一个 contacts.csv 文件,里面有客户联系方式。对于每一行,打开 crm.example.com,点击“添加联系人”,填写姓名、邮箱和电话,然后提交。

Example 4: Operating on logged-in sites like Google Docs

根据最近的 Git 提交,起草一份项目更新,并添加到我的 Google Doc(网址:docs.google.com/document/d/abc123)。

Example 5: Data extraction and saving

打开产品列表页面,提取每个商品的名称、价格和库存状态,保存为 CSV 文件。

Example 6: Record a demo GIF

录制一个 GIF,展示从购物车添加商品到结账确认的完整流程。

Example 7: Multi-site workflow

查看我明天的日历,对于每个有外部参会者的会议,查找他们公司的网站并添加备注。