NavigateEvent Class

https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-navigateevent-interface: fired at the navigation API object of a window when its navigable navigates. Its listeners can cancel the navigation, or intercept it to convert it into a same-document navigation.

public sealed class NavigateEvent : Event
Inheritance
Event NavigateEvent

Constructors

NameDescription
NavigateEvent(string, NavigateEventInit)Creates a navigate event of the given type with the given initialization dictionary.

NavigateEvent(string, NavigateEventInit)

NavigationEvents.cs

Creates a navigate event of the given type with the given initialization dictionary.

public NavigateEvent(string type, NavigateEventInit eventInitDict)

Properties

NameDescription
CanInterceptGets a value indicating whether the navigation can be intercepted to become a same-document navigation.
DestinationGets the destination of the navigation.
DownloadRequestGets the download attribute value of the link that started the navigation, or null.
FormDataGets the data of the form submission that started the navigation, if any.
HasUAVisualTransitionGets a value indicating whether the user agent already performed a visual transition for the navigation.
HashChangeGets a value indicating whether the navigation only changes the fragment of the URL.
InfoThe info given to the navigation API method that started the navigation (a value of the script engine), or null for undefined.
NavigationTypeThe navigation type; a precommit handler can change a "push" to a "replace" and conversely.
SignalGets the signal that is aborted when the navigation is canceled.
SourceElementGets the element that started the navigation, or null.
UserInitiatedGets a value indicating whether the navigation is initiated by the user.

Gets a value indicating whether the navigation can be intercepted to become a same-document navigation.

public bool CanIntercept { get; }

Gets the destination of the navigation.

public NavigationDestination Destination { get; }

DownloadRequest

NavigationEvents.cs

Gets the download attribute value of the link that started the navigation, or null.

public string? DownloadRequest { get; }

Gets the data of the form submission that started the navigation, if any.

public FormData? FormData { get; }

HasUAVisualTransition

NavigationEvents.cs

Gets a value indicating whether the user agent already performed a visual transition for the navigation.

public bool HasUAVisualTransition { get; }

Gets a value indicating whether the navigation only changes the fragment of the URL.

public bool HashChange { get; }

The info given to the navigation API method that started the navigation (a value of the script engine), or null for undefined.

public object? Info { get; }

Gets the signal that is aborted when the navigation is canceled.

public AbortSignal Signal { get; }

SourceElement

NavigationEvents.cs

Gets the element that started the navigation, or null.

public Element? SourceElement { get; }

UserInitiated

NavigationEvents.cs

Gets a value indicating whether the navigation is initiated by the user.

public bool UserInitiated { get; }

Methods

NameDescription
Intercept(NavigationInterceptOptions?)https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-intercept
Scroll()https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-scroll: processes the scroll behavior of the navigation now.

Intercept(NavigationInterceptOptions?)

NavigationEvents.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-intercept

public void Intercept(NavigationInterceptOptions? options = null)

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-scroll: processes the scroll behavior of the navigation now.

public void Scroll()