共用方式為


WebView2.NavigationStarting 事件

定義

當 WebView2 的主框架巡覽至不同的 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) 

事件類型

備註

重新導向也會引發此事件,而導覽標識碼與原始標識符相同。

適用於