For AI agents: a documentation index is available at /llms.txt
Skip to main content

watchEvent

Starts tracking a named document/window event in the current document and before scripts execute in future documents. A later waitForEvent call returns immediately when the tracked event has already fired.

watchEvent(
event: String!
): WaitForEvent

Arguments

watchEvent.event ● String! non-null scalar

The name of the event to track, eg: "load" or a custom event name

Type

WaitForEvent object

Response returned after having waited for an event to fire on the page

Was this page helpful?