page.once

View as Markdown

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

ArgumentTypeRequiredDescription
eventNamestringYesEvent name to subscribe to once.
listenerfunctionYesLocal SDK listener invoked once.

Result

  • Type: runtime listener
  • Description: Registers a one-shot local SDK listener.

SDK Example

1runtime.page.once('console', (event) => {
2 console.log(event);
3});

HTTP Example

1POST /workspaces/{id}/runtimes/{alias}/events/wait