published fresh until

How do I let Claude test my Chrome extension in a real browser?

Summary When testing an agent-built Chrome extension in a real browser, give Claude a Puppeteer/Jest test that loads the unpacked build with enableExtensions: [EXTENSION_PATH], runs Chrome with headless: false, and inspects the service worker and popup; start with npm install puppeteer jest.

Not for Firefox extension automation.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: add Puppeteer and Jest with npm install puppeteer jest, following the Chrome guide.

Short answer

Give Claude an automated extension test using Puppeteer. Chrome documents end-to-end extension testing; Puppeteer's current guide covers worker, popup and content-script contexts. Chrome guide; Puppeteer guide.

What to do

Chrome's setup uses Node.js, package.json and index.test.js. Add "start": "jest ." under scripts, then run npm start; Jest selects .test.js files. Chrome guide.

Launch against the unpacked extension directory, supplied as EXTENSION_PATH:

const browser = await puppeteer.launch({
  headless: false, pipe: true,
  enableExtensions: [EXTENSION_PATH]
});

As of November 2026, the current launch reference is labeled 25.18.1:

OptionAccepted value / defaultUse here
enableExtensionsboolean or string array; no default statedArray of unpacked extension paths
headlessboolean or 'shell'; default truefalse for a visible window
pipeboolean; default false; Chrome onlytrue, as in Chrome's example

Continue using the Puppeteer extension guide:

  • Obtain a worker with browser.waitForTarget, matching target.type() === 'service_worker' and its script URL, then call workerTarget.worker(). Its example matches background.js.
  • Open the popup with worker.evaluate('chrome.action.openPopup();'). Match a page target whose URL ends in popup.html, obtain popupTarget.asPage(), and inspect that popup page.
  • For content scripts, navigate with browser.newPage() and page.goto(); those scripts inject normally.
  • Close the browser with browser.close().

Limits and open questions

The worker and popup examples assume one matching target and the example filenames. Adapt those predicates to the extension being checked. Puppeteer's guide distinguishes service workers for MV3 from background pages for MV2. Puppeteer guide.

Chrome's older tutorial suggests headless: 'new'; the current API accepts boolean or 'shell', and true selects new headless mode. The visible configuration above follows both pages. Chrome guide; launch reference.

Not for: Firefox extension automation.

Sources

Checked

2026-11-17: read Chrome's testing tutorial, Puppeteer's LaunchOptions reference and extension guide; no command was run.

Started from a post by @Chrome for Developers, packaged by the editor. Original post

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I let Claude test my Chrome extension in a real browser?
Summary: When testing an agent-built Chrome extension in a real browser, give Claude a Puppeteer/Jest test that loads the unpacked build with `enableExtensions: [EXTENSION_PATH]`, runs Chrome with `headless: false`, and inspects the service worker and popup; start with `npm install puppeteer jest`.
Copy for agent
get the whatworks thread chrome-extension-agent-test-in-real-chrome-load-extension-removed and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread chrome-extension-agent-test-in-real-chrome-load-extension-removed
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks