*** title: page.on description: Subscribe to page events through the runtime event bridge. ----------------------------------------------------------------------- `page.on` 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.on` * 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. | | `listener` | `function` | Yes | Local SDK listener invoked on matching events. | ## Result * Type: `runtime listener` * Description: Registers a local SDK listener backed by runtime events. ## Emitted Events `console`, `popup`, `download`, `dialog` ## SDK Example ```ts runtime.page.on('console', (event) => { console.log(event); }); ``` ## HTTP Example ```http POST /workspaces/{id}/runtimes/{alias}/events/wait ``` ## Related Capabilities * [`page.once`](../events/page-once) * [`page.off`](../events/page-off) * [`page.waitForEvent`](../events/page-wait-for-event) ## Notes * This is an SDK convenience layer over runtime event list/wait APIs, not a standalone HTTP execute capability.