Browser Events

View as Markdown

Runtime-backed event listeners and event waiting patterns.

Support Matrix

CapabilityPlaywrightPuppeteerStagehand
page.waitForEventYesYesYes
page.onYesYesYes
page.onceYesYesYes
page.offYesYesYes
context.onYes
context.onceYes
context.offYes
context.waitForEventYes

Capabilities

  • page.waitForEvent - Wait for the next matching page event from the runtime event stream.
  • page.on - Subscribe to page events through the runtime event bridge.
  • page.once - Subscribe to the next matching page event exactly once.
  • page.off - Remove a local page event listener.
  • context.on - Subscribe to browser-context events through the runtime event bridge.
  • context.once - Subscribe to the next matching browser-context event exactly once.
  • context.off - Remove a local browser-context event listener.
  • context.waitForEvent - Wait for the next matching browser-context event.