English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Claw in Chrome Deep Dive: Unlocking the Claude Browser Extension

Forum topic · 小凯 · 2026-04-06

Summary

Claw in Chrome is a community-modified, open-source fork (v1.0.66) of Anthropic's official Claude in Chrome extension, published on GitHub by S-Trespassing. It removes the login and subscription restrictions of the original extension and adds support for custom model providers. The project is built on Chrome Extension Manifest V3 with React + TypeScript and Vite, using a Service Worker message bridge, a SidePanel chat UI, an MCP-based permission system, and browser automation capabilities (tab management, clicking, form filling, screenshots, JavaScript execution, accessibility tree access). Its most notable innovation is a provider-format adapter that intercepts the global fetch function to transparently translate Anthropic Messages API requests into OpenAI Chat Completions or Responses API formats, enabling any compatible provider. It also includes editable reasoning effort and context window parameters, multi-provider profile switching, model list fetching from /models endpoints, 13-language i18n, OAuth/offscreen support, and a multi-layer debug log sanitizer that redacts API keys, tokens, URLs, and prompt content. The article analyzes the deobfuscated code structure, installation steps, security implications of its broad permission set (debugger, nativeMessaging, scripting), and its potential to serve as a browser relay component for OpenClaw.

Claw in Chrome Deep Dive: Unlocking the Claude Browser Extension

> When official restrictions become shackles, community ingenuity forges the key.

Key points

  • Claw in Chrome is a community-modified, open-source unlock of Anthropic's official Claude in Chrome extension, version 1.0.66, developed by S-Trespassing.
  • It removes the forced Anthropic account login and Claude Pro/Team subscription requirements of the original.
  • Its core innovation is a custom provider system: any OpenAI-compatible or Anthropic-compatible API endpoint can power the extension, with editable reasoning effort, context window, and multiple switchable provider profiles.
  • The extension keeps the original's powerful features: SidePanel chat, MCP-based permission management, OAuth, 13-language i18n, and deep browser automation (click, fill forms, navigate, screenshot, execute JavaScript, read accessibility tree).
  • Debug logging includes multi-layer data sanitization so exported logs are safe to share.
  • Technical architecture

  • Stack: Chrome Extension Manifest V3, React + TypeScript, Vite bundling, Chrome Storage API with a custom useStorageState hook, Chrome Extension Message API.
  • Core modules:
  • sidepanel-*.js — main chat UI, model selection, permission prompts, OAuth/credential refresh.
  • service-worker-*.js — message routing hub: sidepanel events, OAuth refresh, MCP permission replies, native messaging, clau.de/chrome/* URL protocol handling.
  • PermissionManager-*.js — permission checks (sidePanel, scripting, debugger), requests, and status broadcast.
  • mcpPermissions-*.js — browser automation tools with a domain-verification security check before each action.
  • Custom provider adapter

    The standout feature is a request/response translation layer that intercepts the global fetch:

  • Supported formats: anthropic (/messages), openai_chat (/chat/completions), openai_responses (/responses).
  • Anthropic-format requests are transparently converted to OpenAI format (and responses back), including SSE streaming, error normalization, and token usage mapping.
  • Zero modification of original code required; format is auto-inferred from base URL and model name.
  • Models can be fetched from a provider's /models endpoint, with conversational models (claude, gpt, o-series, sonnet, opus, haiku…) sorted first.
  • Reverse engineering methodology

    The project is based on deobfuscating the minified production build: breakpoint debugging, string search for API endpoints, behavioral analysis, and semantic renaming of compressed identifiers ($Q, qQ, t1, auth.refresh_state, __cpModelBootstrap*).

    Usage

    1. Clone the repo: https://github.com/S-Trespassing/claw-in-chrome 2. Open chrome://extensions/, enable Developer Mode, and load the unpacked folder. 3. Configure a provider in the options page (name, format, base URL, API key, default model, reasoning effort, context window), optionally fetch models, save, and restart the side panel. 4. Toggle the sidebar with Ctrl+E / Cmd+E.

    Security considerations

    The extension requests broad permissions (debugger, nativeMessaging, scripting, tabs, webNavigation, etc.), enabling powerful automation but carrying real risk. Mitigations include sensitive-key redaction in debug logs, managed schema support (URL blocklists, org binding), and the per-action domain verification in automation tools. Install only from trusted sources and disable during sensitive operations.

    Relation to OpenClaw

    Thanks to its MCP support, Claw in Chrome could theoretically act as a Browser Relay for OpenClaw — natively integrated, visible to the user, with no separate relay install — though gateway protocol alignment, security boundary coordination, and Service Worker lifecycle limits remain challenges.

    Outlook

    Potential future directions: Firefox/Safari ports, VS Code integration, and local model support (Ollama, LM Studio).

    References:

  • GitHub: https://github.com/S-Trespassing/claw-in-chrome
  • Chrome Extension docs: https://developer.chrome.com/docs/extensions/
*Based on claw-in-chrome v1.0.66; code analysis is for learning purposes only — respect the applicable open-source licenses.*

Tags

#chrome-extension#claude#browser-automation#reverse-engineering#mcp#openai#manifest-v3#ai-assistant

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177169598