Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Puppeteer Puppeteer Page Creation

From Leeroopedia
Knowledge Sources
Domains Browser_Automation, Testing
Last Updated 2026-02-11 23:00 GMT

Overview

A mechanism that creates a new browser tab (page) within an existing browser instance, providing an isolated context for navigation and interaction.

Description

Page Creation is the step that creates a new browser tab or page within a running browser. Each page operates as an independent unit with its own:

  • Navigation state (URL, history)
  • JavaScript execution context
  • DOM tree
  • Network activity
  • Cookie and storage isolation (when using browser contexts)

In Puppeteer's architecture, the Page object is the central abstraction for most automation tasks. It delegates to Frame objects for content manipulation, provides event subscriptions for network and console activity, and manages the lifecycle of the tab.

Usage

Use this principle immediately after launching a browser and before performing any navigation or page interaction. Create multiple pages when you need to automate multi-tab scenarios or run parallel operations within the same browser instance.

Theoretical Basis

Page creation follows a target-based model derived from the Chrome DevTools Protocol:

# Pseudo-code
1. Browser receives newPage() request
2. Browser instructs the engine to create a new target (tab)
3. A browsing context is allocated with its own renderer
4. A Page object is constructed wrapping the new target
5. The page is associated with a BrowserContext for isolation
6. The Page object is returned for subsequent automation calls

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment