*** title: page.once description: Subscribe to the next matching page event exactly once. -------------------------------------------------------------------- `page.once` is a browser runtime capability in the `page` namespace. ## Availability * Runtime: `browser` * Kind: `event` * Category: `events` * Supported drivers: Playwright, Puppeteer, Stagehand ## SDK Surface * SDK path: `runtime.page.once` * Async: No ## HTTP Surface * Transport: resource route * Route: `POST /workspaces/{id}/runtimes/{alias}/events/wait` * Long-running: No ## Reference Semantics * Requires refs: `page` ## Arguments | Argument | Type | Required | Description | | ----------- | ---------- | -------- | -------------------------------- | | `eventName` | `string` | Yes | Event name to subscribe to once. | | `listener` | `function` | Yes | Local SDK listener invoked once. | ## Result * Type: `runtime listener` * Description: Registers a one-shot local SDK listener. ## SDK Example ```ts runtime.page.once('console', (event) => { console.log(event); }); ``` ## HTTP Example ```http POST /workspaces/{id}/runtimes/{alias}/events/wait ``` ## Related Capabilities * [`page.on`](../events/page-on) * [`page.off`](../events/page-off) * [`page.waitForEvent`](../events/page-wait-for-event)