Skip to main content

Module debugger

Module debugger 

Source
Expand description

Debugger — programmatic control of the Playwright Inspector “PAUSED” overlay.

Available on every BrowserContext via debugger(). Used by IDE integrations and inspector-style tools to pause execution at the next action call, then resume / step / run-to-location under programmatic control. Distinct from the MCP / agent codegen path.

§Example

use playwright_rs::Playwright;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let pw = Playwright::launch().await?;
    let browser = pw.chromium().launch().await?;
    let context = browser.new_context().await?;
    let dbg = context.debugger().await?;

    // Ask Playwright to pause before the next action runs.
    dbg.request_pause().await?;

    // ... your IDE / tool decides when to step the user through ...

    dbg.resume().await?;
    browser.close().await?;
    Ok(())
}

See: https://playwright.dev/docs/api/class-debugger

Structs§

Debugger
Programmatic interface to Playwright Inspector’s pause / resume / step controls. See the module docs.
PausedDetails
Details of the currently paused execution, surfaced via the pausedStateChanged event when the inspector overlay is active.
PausedLocation
Source location for PausedDetails.