pub trait ICoreWebView2NavigationStartingEventArgs: IUnknown {
// Required methods
unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT;
unsafe fn get_is_user_initiated(
&self,
is_user_initiated: *mut BOOL,
) -> HRESULT;
unsafe fn get_is_redirected(&self, is_redirected: *mut BOOL) -> HRESULT;
unsafe fn get_request_headers(
&self,
request_headers: *mut *mut *mut ICoreWebView2HttpRequestHeadersVTable,
) -> HRESULT;
unsafe fn get_cancel(&self, cancel: *mut BOOL) -> HRESULT;
unsafe fn put_cancel(&self, cancel: BOOL) -> HRESULT;
unsafe fn get_navigation_id(&self, navigation_id: *mut u64) -> HRESULT;
}Expand description
Event args for the NavigationStarting event.
Required Methods§
Sourceunsafe fn get_is_user_initiated(&self, is_user_initiated: *mut BOOL) -> HRESULT
unsafe fn get_is_user_initiated(&self, is_user_initiated: *mut BOOL) -> HRESULT
TRUE when the navigation was initiated through a user gesture as
opposed to programmatic navigation by page script. Navigations initiated
via WebView2 APIs are considered as user initiated.
Sourceunsafe fn get_is_redirected(&self, is_redirected: *mut BOOL) -> HRESULT
unsafe fn get_is_redirected(&self, is_redirected: *mut BOOL) -> HRESULT
TRUE when the navigation is redirected.
Sourceunsafe fn get_request_headers(
&self,
request_headers: *mut *mut *mut ICoreWebView2HttpRequestHeadersVTable,
) -> HRESULT
unsafe fn get_request_headers( &self, request_headers: *mut *mut *mut ICoreWebView2HttpRequestHeadersVTable, ) -> HRESULT
The HTTP request headers for the navigation.
> [!NOTE]\n> You are not able to modify the HTTP request headers in a
NavigationStarting event.
Sourceunsafe fn get_cancel(&self, cancel: *mut BOOL) -> HRESULT
unsafe fn get_cancel(&self, cancel: *mut BOOL) -> HRESULT
The host may set this flag to cancel the navigation. If set, the
navigation is not longer present and the content of the current page is
intact. For performance reasons, GET HTTP requests may happen, while
the host is responding. You may set cookies and use part of a request
for the navigation. Cancellation for navigation to about:blank or
frame navigation to srcdoc is not supported. Such attempts are
ignored.
Sourceunsafe fn put_cancel(&self, cancel: BOOL) -> HRESULT
unsafe fn put_cancel(&self, cancel: BOOL) -> HRESULT
Sets the Cancel property.
The ID of the navigation.