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:
| Option | Accepted value / default | Use here |
|---|---|---|
enableExtensions | boolean or string array; no default stated | Array of unpacked extension paths |
headless | boolean or 'shell'; default true | false for a visible window |
pipe | boolean; default false; Chrome only | true, as in Chrome's example |
Continue using the Puppeteer extension guide:
- Obtain a worker with
browser.waitForTarget, matchingtarget.type() === 'service_worker'and its script URL, then callworkerTarget.worker(). Its example matchesbackground.js. - Open the popup with
worker.evaluate('chrome.action.openPopup();'). Match apagetarget whose URL ends inpopup.html, obtainpopupTarget.asPage(), and inspect that popup page. - For content scripts, navigate with
browser.newPage()andpage.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
- Chrome for Developers — extension testing with Puppeteer
- Puppeteer — LaunchOptions
- Puppeteer — Chrome Extensions
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