Udostępnij za pośrednictwem


WebView2.NavigationStarting Event

Definition

Occurs when the main frame of the WebView2 navigates to a different URI.

// Register
event_token NavigationStarting(TypedEventHandler<WebView2, CoreWebView2NavigationStartingEventArgs const&> const& handler) const;

// Revoke with event_token
void NavigationStarting(event_token const* cookie) const;

// Revoke with event_revoker
WebView2::NavigationStarting_revoker NavigationStarting(auto_revoke_t, TypedEventHandler<WebView2, CoreWebView2NavigationStartingEventArgs const&> const& handler) const;
public event TypedEventHandler<WebView2,CoreWebView2NavigationStartingEventArgs> NavigationStarting;
function onNavigationStarting(eventArgs) { /* Your code */ }
webView2.addEventListener("navigationstarting", onNavigationStarting);
webView2.removeEventListener("navigationstarting", onNavigationStarting);
- or -
webView2.onnavigationstarting = onNavigationStarting;
Public Custom Event NavigationStarting As TypedEventHandler(Of WebView2, CoreWebView2NavigationStartingEventArgs) 

Event Type

Remarks

Redirects also raise this event, and the navigation ID is the same as the original one.

Applies to