# Behavior traces — puppeteer/puppeteer

> Canonical page: https://codevetter.com/unpack/puppeteer/behavior-traces

# Behavior traces — puppeteer/puppeteer

Scanned commit 2e45a3af43231cd658285e4da5e7f53e40f24edf (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The investigated flows follow concrete calls from consumer entrypoints to browser processes, protocol commands, and filesystem output. Launch includes browser-dependent connection branches and cleanup behavior. Navigation distinguishes document replacement from same-document changes, while capture guards shared browser-context operations. Installation has separate cache-hit, incomplete-install, download, extraction, and metadata branches.
- Startup: importing puppeteer constructs PuppeteerNode → launch selects the default/requested browser → #getLauncher returns ChromeLauncher or FirefoxLauncher → the selected launcher receives LaunchOptions. — [packages/puppeteer/src/puppeteer.ts#L16-L20](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer/src/puppeteer.ts#L16-L20) [packages/puppeteer-core/src/node/PuppeteerNode.ts#L139-L162](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/PuppeteerNode.ts#L139-L162)
- Chrome launch: ChromeLauncher.launch → BrowserLauncher.launch → computeLaunchArguments assembles flags, allocates a temporary profile when needed, and resolves the executable → launch spawns the browser. — [packages/puppeteer-core/src/node/ChromeLauncher.ts#L37-L60](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/ChromeLauncher.ts#L37-L60) [packages/puppeteer-core/src/node/ChromeLauncher.ts#L65-L148](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/ChromeLauncher.ts#L65-L148) [packages/puppeteer-core/src/node/BrowserLauncher.ts#L127-L174](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/BrowserLauncher.ts#L127-L174) [packages/puppeteer-core/src/node/BrowserLauncher.ts#L212-L226](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/BrowserLauncher.ts#L212-L226)
- CDP connection startup: BrowserLauncher chooses pipe or socket → socket startup waits for the browser's endpoint output and creates WebSocketTransport → Connection is constructed → CdpBrowser._create initializes the browser → waitForPageTarget runs unless disabled. — [packages/puppeteer-core/src/node/BrowserLauncher.ts#L270-L320](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/BrowserLauncher.ts#L270-L320) [packages/puppeteer-core/src/node/BrowserLauncher.ts#L367-L371](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/BrowserLauncher.ts#L367-L371) [packages/puppeteer-core/src/node/BrowserLauncher.ts#L450-L479](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/node/BrowserLauncher.ts#L450-L479)
- New page: CdpBrowser.newPage → defaultContext.newPage → screenshot-operation guard → _createPageInContext → Target.createTarget → waitForTarget → initialization check → target.page. — [packages/puppeteer-core/src/cdp/Browser.ts#L410-L454](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/cdp/Browser.ts#L410-L454) [packages/puppeteer-core/src/cdp/BrowserContext.ts#L132-L134](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/cdp/BrowserContext.ts#L132-L134)
- Navigation: Page.goto → mainFrame().goto → URL restriction check → LifecycleWatcher → Page.navigate raced with termination → loaderId selects new/same-document completion → navigationResponse → watcher.dispose. — [packages/puppeteer-core/src/api/Page.ts#L1882-L1887](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/Page.ts#L1882-L1887) [packages/puppeteer-core/src/cdp/Frame.ts#L148-L233](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/cdp/Frame.ts#L148-L233)
- Locator click: Locator.#click waits for a handle → checks viewport/stability/enabled conditions → emits Action → ElementHandle.click scrolls and finds a clickable point → mouse.click; errors are retried under timeout/abort control. — [packages/puppeteer-core/src/api/locators/locators.ts#L179-L191](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/locators/locators.ts#L179-L191) [packages/puppeteer-core/src/api/locators/locators.ts#L399-L427](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/locators/locators.ts#L399-L427) [packages/puppeteer-core/src/api/ElementHandle.ts#L769-L776](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/ElementHandle.ts#L769-L776)
- Screenshot persistence: Page.screenshot obtains the context guard → validates and normalizes options → optionally changes/restores viewport → CdpPage._screenshot sends Page.captureScreenshot → byte-output branch decodes and writes the optional path. — [packages/puppeteer-core/src/api/Page.ts#L2881-L2984](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/Page.ts#L2881-L2984) [packages/puppeteer-core/src/cdp/Page.ts#L1168-L1220](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/cdp/Page.ts#L1168-L1220) [packages/puppeteer-core/src/api/Page.ts#L2564-L2572](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer-core/src/api/Page.ts#L2564-L2572)
- Browser installation: downloadBrowsers applies proxy/configuration and skip conditions → concurrent downloadBrowser jobs resolve builds → install → installWithProviders → installUrl reuses a valid installed executable or downloads/unpacks, records aliases, runs setup, and removes the archive. — [packages/puppeteer/src/node/install.ts#L67-L147](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/puppeteer/src/node/install.ts#L67-L147) [packages/browsers/src/install.ts#L315-L329](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/browsers/src/install.ts#L315-L329) [packages/browsers/src/install.ts#L244-L262](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/browsers/src/install.ts#L244-L262) [packages/browsers/src/install.ts#L465-L526](https://github.com/puppeteer/puppeteer/blob/2e45a3af43231cd658285e4da5e7f53e40f24edf/packages/browsers/src/install.ts#L465-L526)

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)
