# Extension points — microsoft/playwright

> Canonical page: https://codevetter.com/unpack/playwright/extension-points

# Extension points — microsoft/playwright

Scanned commit b630e71fcda7885885c459bcbb88e5bfa7c0a1ac (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The repository provides concrete registries, factories, and schemas for extending behavior. Some are public configuration surfaces, while others are internal integration seams. Protocol and generated-type changes require coordinated edits across boundaries. Browser engines and injected selector behavior have explicit synchronization requirements.
- Connection.registerObjectFactories installs type-to-ChannelOwner constructors in a map; the constructor registers Browser, BrowserContext, Page, Route, Tracing, Android, Electron, and other protocol object types. — [packages/playwright-core/src/client/connection.ts#L98-142](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/client/connection.ts#L98-L142)
- Protocol commands are declared in YAML with parameter mixins and typed returns; generate_channels emits client/server channel interfaces, structs, metadata, and runtime validators. — [packages/protocol/spec/browserType.yml#L15-58](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/protocol/spec/browserType.yml#L15-L58) [utils/generate_channels.js#L483-487](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/utils/generate_channels.js#L483-L487)
- createReporters is a constructor registry for built-ins and loads custom reporter modules from configuration or PW_TEST_REPORTER, adapting them through wrapReporterAsV2. — [packages/playwright/src/runner/reporters.ts#L42-76](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright/src/runner/reporters.ts#L42-L76)
- TestRunnerPlugin defines asynchronous setup/teardown hooks; registration accepts an instance or synchronous/asynchronous factory, and createPluginSetupTasks invokes those lifecycle hooks. — [packages/playwright/src/plugins/index.ts#L20-29](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright/src/plugins/index.ts#L20-L29) [packages/playwright/src/runner/tasks.ts#L192-202](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright/src/runner/tasks.ts#L192-L202)
- Selectors.register accepts custom engines after name/reserved/duplicate checks; parseSelector selects main or utility execution worlds based on engine contentScript and built-in requirements. — [packages/playwright-core/src/server/selectors.ts#L58-94](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/server/selectors.ts#L58-L94)
- Agent tool modules are assembled in browserTools; filteredTools retains core or enabled capabilities, excludes skillOnly tools, and removes selector fields from exposed schemas. — [packages/playwright-core/src/tools/backend/tools.ts#L51-93](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/tools/backend/tools.ts#L51-L93)
- defineTool preserves a typed schema/handler definition; defineTabTool wraps handlers with ensureTab and modal-state compatibility checks, allowing tools to declare which modal state they clear. — [packages/playwright-core/src/tools/backend/tool.ts#L51-83](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/tools/backend/tool.ts#L51-L83)
- BrowserType is an abstract engine seam for defaultArgs, connectToTransport, amendEnvironment, startup-log rewriting, and graceful close; CLI additions attach through decorateProgram and the testOptions command table. — [packages/playwright-core/src/server/browserType.ts#L334-362](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/server/browserType.ts#L334-L362) [packages/playwright-core/src/cli/program.ts#L36-50](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright-core/src/cli/program.ts#L36-L50) [packages/playwright/src/program.ts#L40-53](https://github.com/microsoft/playwright/blob/b630e71fcda7885885c459bcbb88e5bfa7c0a1ac/packages/playwright/src/program.ts#L40-L53)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
