*** title: Browser Events description: Runtime-backed event listeners and event waiting patterns. ----------------------------------------------------------------------- Runtime-backed event listeners and event waiting patterns. ## Support Matrix | Capability | Playwright | Puppeteer | Stagehand | | -------------------------------------------------- | ---------- | --------- | --------- | | [`page.waitForEvent`](./page-wait-for-event) | Yes | Yes | Yes | | [`page.on`](./page-on) | Yes | Yes | Yes | | [`page.once`](./page-once) | Yes | Yes | Yes | | [`page.off`](./page-off) | Yes | Yes | Yes | | [`context.on`](./context-on) | Yes | | | | [`context.once`](./context-once) | Yes | | | | [`context.off`](./context-off) | Yes | | | | [`context.waitForEvent`](./context-wait-for-event) | Yes | | | ## Capabilities * [`page.waitForEvent`](./page-wait-for-event) - Wait for the next matching page event from the runtime event stream. * [`page.on`](./page-on) - Subscribe to page events through the runtime event bridge. * [`page.once`](./page-once) - Subscribe to the next matching page event exactly once. * [`page.off`](./page-off) - Remove a local page event listener. * [`context.on`](./context-on) - Subscribe to browser-context events through the runtime event bridge. * [`context.once`](./context-once) - Subscribe to the next matching browser-context event exactly once. * [`context.off`](./context-off) - Remove a local browser-context event listener. * [`context.waitForEvent`](./context-wait-for-event) - Wait for the next matching browser-context event.