Chrome DevTools for agents extension testing gives QA engineers a practical way to let an approved coding agent operate a live Chrome browser, inspect extension surfaces, and collect debugging clues. The useful part is not that an agent can click a popup. The useful part is that it can connect browser behavior to console output, service-worker state, network activity, and the extension source while you retain control of the test boundary.
This tutorial uses a controlled Chrome profile, synthetic data, an unpacked Manifest V3 extension, and one short journey. You will load and reload the extension, exercise its popup and content script, inspect the background service worker, capture evidence, and then reproduce the result independently. The workflow is designed for QA engineers, SDETs, automation testers, and AI testing learners who need reviewable evidence rather than a persuasive agent summary.
What the official Chrome tooling supports
Chrome describes DevTools for agents as a suite with an MCP server, a targeted command-line interface, and agentic skills. The MCP server connects an AI coding agent to a live browser. Chrome lists compatible environments including Antigravity, Claude Code, Cursor, Copilot, Codex, and other tools that support MCP.
For extension work, Chrome says the extension tool category must be enabled. The documented capabilities include installing and uninstalling extensions, listing and reloading them, triggering extension actions, and inspecting surfaces from a popup to a background service worker. The official extension guide positions these tools as a way to verify generated extension code in Chrome, not merely to generate more code.
The security warning matters. A connected agent can read, inspect, debug, modify, and interact with browser data. If the connected profile is signed in, the agent may effectively act with that session. Use a dedicated QA profile, test accounts, synthetic records, narrowly approved origins, and no production credentials.
QA scenario: debug a failing extension popup
Assume an unpacked extension adds a small status badge to an approved staging page. Clicking the toolbar action opens a popup that should show the current page title and a successful connection state. A regression causes the popup to remain in a loading state after the extension is reloaded.
Your goal is to identify whether the failure comes from the popup, its message to the content script, the background service worker, a missing permission, or stale extension state. Do not ask the agent to rewrite the extension immediately. First establish a repeatable failure and collect observations.
Step 1: define the safety boundary
- Create a separate Chrome profile used only for this exercise.
- Use a staging origin and synthetic account.
- Remove personal bookmarks, cookies, saved passwords, payment data, and unrelated extensions.
- Record the extension commit, Chrome version, manifest, test URL, expected result, and stop conditions.
- Stop if the agent navigates outside approved origins, requests production access, or proposes weakening a security control.
If your setup uses automatic connection to an existing Chrome profile, make the profile disposable and purpose-built. Convenience does not change the exposure described in Chrome’s security guidance.
Step 2: configure the extension tool category
Follow the official setup instructions for your approved coding agent. Chrome documents an MCP configuration option named --categoryExtensions, with --category-extensions used by some interfaces, to expose extension-specific tools. Confirm the exact syntax in the current documentation for your environment.
For example, Chrome’s documented Claude Code setup uses a project-scoped MCP server and adds both the extension category and automatic connection options. Codex can add the Chrome DevTools MCP server from its CLI, while other MCP-compatible agents can use JSON configuration. Treat copied commands as setup examples and check the current official page before installation.
After configuration, start Chrome with the required remote-debugging approval if your selected connection method needs it. Record the visible automation-control banner or permission prompt. Do not suppress a browser security prompt just to make the tutorial smoother.
Step 3: establish a deterministic baseline
Before involving the agent, load the unpacked extension manually from the known build folder. Pin it, open the staging page, click the action, and reproduce the loading-state defect. Save the extension ID, commit SHA, manifest contents, exact page URL, steps, screenshot, console output, and time of the run.
Repeat the journey once in a fresh tab. If the symptom does not reproduce consistently, investigate state and flakiness before allowing edits. An agent cannot prove the root cause of an unstable baseline.
Step 4: give the agent a bounded investigation prompt
Use Chrome DevTools extension tools on the approved QA profile only.
Target: the unpacked extension from the current workspace.
Allowed origin: https://staging.example.test only.
Reproduce: open the page, trigger the extension action, and observe the popup.
Inspect popup console, content-script messaging, permissions, and background service-worker logs.
Do not edit files, install other extensions, sign in, or visit another origin.
Return observations, timestamps, tool evidence, and up to three hypotheses.
Stop if access or scope must expand.
This prompt separates observation from repair. It also tells the agent what not to do and what evidence the report must contain.
Step 5: inspect each extension surface
Ask the agent to list the installed extension and verify the expected ID and source. Then exercise the toolbar action and inspect the popup. Record whether the popup DOM renders, whether its console reports an exception, and whether its message request is sent.
Next, inspect the target page for the expected content-script effect and console messages. Finally, inspect the background service worker. A Manifest V3 worker may stop when idle, so distinguish a normal inactive worker from a worker that fails during an event. Preserve the precise error, source location, and event sequence.
Check the manifest and permissions against observed behavior. A missing host permission, incorrect match pattern, message listener error, or stale unpacked build can look similar from the popup. Do not accept the first plausible explanation without evidence from the relevant surface.
Step 6: test reload and state behavior
Use the extension tools to reload the approved unpacked extension, then repeat the same journey. Record what changes after reload: extension ID, service-worker lifecycle, popup state, injected content, storage, open tabs, and console messages.
- Fresh browser session with the extension loaded.
- Extension reload while the staging tab remains open.
- Staging page refresh after extension reload.
- Popup opened before and after the content script is available.
- Worker idle followed by a new action event.
Reload behavior is especially useful for distinguishing a code defect from stale state or a missing reinjection step. Document the difference instead of hiding it with repeated retries.
Step 7: approve the smallest repair
Only after the evidence supports a hypothesis should you permit a code change. Define allowed files and forbidden shortcuts. Preserve permissions, do not add broad host access, do not add fixed delays, do not swallow errors, and do not replace a meaningful assertion with a visibility-only check.
Review the diff yourself. If the repair changes the manifest, permissions, message format, storage schema, or background-worker behavior, expand the deterministic regression scope appropriately.
Step 8: validate independently
Rebuild from a clean checkout and load the resulting unpacked package manually. Repeat the original steps without relying on the agent’s session. Run the project’s deterministic extension tests, including popup, content-script, messaging, permission, reload, and service-worker coverage where available.
Compare the final result with the baseline. A defensible report includes the starting SHA, fixed SHA, Chrome version, extension ID, commands, screenshots, console evidence, relevant trace or video, and the exact test results. The agent transcript is supporting context, not the final proof.
Screenshot checklist
- The dedicated QA Chrome profile with sensitive data absent.
- The extension-specific MCP configuration with secrets redacted.
- The unpacked extension entry and extension ID.
- The failing popup in its loading state.
- The popup console error and source location.
- The background service-worker inspection view.
- The extension reload followed by the repeated journey.
- The reviewed code diff and deterministic passing test report.
Common mistakes
- Using a personal browser profile: the agent can inspect and act on visible browser data.
- Editing before reproducing: a plausible patch can erase the evidence needed to identify stale state or a lifecycle problem.
- Ignoring separate surfaces: popup, content script, page, service worker, and manifest each provide different evidence.
- Treating an idle worker as a crash: confirm the event and error sequence.
- Broadening permissions to make the test pass: permission changes require security and product review.
- Trusting the agent transcript: independently rebuild, rerun, and preserve deterministic results.
References
- Chrome DevTools for agents: get started
- Build extensions with coding agents
- What’s new in web extensions: I/O 2026 recap
- Chrome extension end-to-end testing
FAQ
Can Chrome DevTools for agents test extension popups and service workers?
Chrome’s official extension guidance says the tools can trigger and inspect extension surfaces including popups and background service workers when extension tooling is enabled.
Should I connect the agent to my normal Chrome profile?
No for this QA workflow. Chrome warns that the agent can read and act on browser data. Use a dedicated profile with synthetic accounts and no personal or production data.
Does an agent finding prove the extension is fixed?
No. Rebuild from a clean checkout, reproduce the journey independently, run deterministic tests, and review the final diff.
Why test extension reload behavior?
Reload testing helps separate code defects from stale tabs, content-script reinjection, storage state, and service-worker lifecycle behavior.
Conclusion
Chrome DevTools for agents extension testing is most valuable as a controlled investigation loop. Give the agent a disposable browser context, one explicit journey, narrow permissions, and evidence requirements. Inspect the popup, page, content script, service worker, and manifest before approving a repair. Then rebuild and rerun the workflow independently. That combination gives QA teams faster debugging without surrendering reproducibility, security review, or human release ownership.

