*** title: context.once description: Subscribe to the next matching browser-context event exactly once. ------------------------------------------------------------------------------- `context.once` is a browser runtime capability in the `context` namespace. ## Availability * Runtime: `browser` * Kind: `event` * Category: `events` * Supported drivers: Playwright ## SDK Surface * SDK path: `runtime.browserContext.once` * Async: No ## HTTP Surface * Transport: resource route * Route: `POST /workspaces/{id}/runtimes/{alias}/events/wait` * Long-running: No ## Reference Semantics * Requires refs: `context` ## Arguments | Argument | Type | Required | Description | | ----------- | ---------- | -------- | ---------------------------------------- | | `eventName` | `string` | Yes | Context 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 for context events. ## SDK Example ```ts runtime.browserContext.once('console', (event) => { console.log(event); }); ``` ## HTTP Example ```http POST /workspaces/{id}/runtimes/{alias}/events/wait ``` ## Related Capabilities * [`context.on`](../events/context-on) * [`context.off`](../events/context-off) * [`context.waitForEvent`](../events/context-wait-for-event)