navigations
A sequence of all the navigation events that occur throughout the webpage, including both user navigation and programmatic navigation.
Declaration
@MainActor final var navigations: some AsyncSequence<WebPage.NavigationEvent, any Error> { get }Discussion
A specific navigation is comprised of a sequential set of WebPage.NavigationEvents; a new navigation begins when an event is WebPage.NavigationEvent.startedProvisionalNavigation.
This property produces a new sequence each time it is called, and starts tracking events as soon as it is created. The sequence is indefinite, but may be terminated under several circumstances:
The owning WebPage’s lifetime ends.
An error occurs during navigation, at which point the sequence will throw the error and terminate.
The
Taskenclosing iteration of the sequence is cancelled.
To track a specific programmatic navigation, use the return value of one of the loading APIs.