ICoreWebView2_2

Trait ICoreWebView2_2 

Source
pub trait ICoreWebView2_2: ICoreWebView2 {
    // Required methods
    unsafe fn add_web_resource_response_received(
        &self,
        event_handler: *mut *mut ICoreWebView2WebResourceResponseReceivedEventHandlerVTable,
        token: *mut EventRegistrationToken,
    ) -> HRESULT;
    unsafe fn remove_web_resource_response_received(
        &self,
        token: EventRegistrationToken,
    ) -> HRESULT;
    unsafe fn navigate_with_web_resource_request(
        &self,
        request: *mut *mut ICoreWebView2WebResourceRequestVTable,
    ) -> HRESULT;
    unsafe fn add_domcontent_loaded(
        &self,
        event_handler: *mut *mut ICoreWebView2DOMContentLoadedEventHandlerVTable,
        token: *mut EventRegistrationToken,
    ) -> HRESULT;
    unsafe fn remove_domcontent_loaded(
        &self,
        token: EventRegistrationToken,
    ) -> HRESULT;
    unsafe fn get_cookie_manager(
        &self,
        cookie_manager: *mut *mut *mut ICoreWebView2CookieManagerVTable,
    ) -> HRESULT;
    unsafe fn get_environment(
        &self,
        environment: *mut *mut *mut ICoreWebView2EnvironmentVTable,
    ) -> HRESULT;
}
Expand description

A continuation of the ICoreWebView2 interface.

Required Methods§

Source

unsafe fn add_web_resource_response_received( &self, event_handler: *mut *mut ICoreWebView2WebResourceResponseReceivedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Add an event handler for the WebResourceResponseReceived event. WebResourceResponseReceived is raised when the WebView receives the response for a request for a web resource (any URI resolution performed by the WebView; such as HTTP/HTTPS, file and data requests from redirects, navigations, declarations in HTML, implicit favicon lookups, and fetch API usage in the document). The host app can use this event to view the actual request and response for a web resource. There is no guarantee about the order in which the WebView processes the response and the host app’s handler runs. The app’s handler will not block the WebView from processing the response. \snippet ScenarioAuthentication.cpp WebResourceResponseReceived

Source

unsafe fn remove_web_resource_response_received( &self, token: EventRegistrationToken, ) -> HRESULT

Remove an event handler previously added with add_WebResourceResponseReceived.

Source

unsafe fn navigate_with_web_resource_request( &self, request: *mut *mut ICoreWebView2WebResourceRequestVTable, ) -> HRESULT

Navigates using a constructed WebResourceRequest object. This lets you provide post data or additional request headers during navigation. The headers in the WebResourceRequest override headers added by WebView2 runtime except for Cookie headers. Method can only be either “GET” or “POST”. Provided post data will only be sent only if the method is “POST” and the uri scheme is HTTP(S). \snippet ScenarioNavigateWithWebResourceRequest.cpp NavigateWithWebResourceRequest

Source

unsafe fn add_domcontent_loaded( &self, event_handler: *mut *mut ICoreWebView2DOMContentLoadedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT

Add an event handler for the DOMContentLoaded event. DOMContentLoaded is raised when the initial html document has been parsed. This aligns with the the document’s DOMContentLoaded event in html.

\snippet ScenarioDOMContentLoaded.cpp DOMContentLoaded

Source

unsafe fn remove_domcontent_loaded( &self, token: EventRegistrationToken, ) -> HRESULT

Remove an event handler previously added with add_DOMContentLoaded.

Gets the cookie manager object associated with this ICoreWebView2. See ICoreWebView2CookieManager.

\snippet ScenarioCookieManagement.cpp CookieManager

Source

unsafe fn get_environment( &self, environment: *mut *mut *mut ICoreWebView2EnvironmentVTable, ) -> HRESULT

Exposes the CoreWebView2Environment used to create this CoreWebView2.

Trait Implementations§

Source§

impl ComInterface for dyn ICoreWebView2_2

Source§

const IID: IID = IID_ICORE_WEB_VIEW2_2

The associated id for this interface
Source§

type VTable = ICoreWebView2_2VTable

A COM compatible V-Table
Source§

type Super = dyn ICoreWebView2

The interface that this interface inherits from
Source§

fn is_iid_in_inheritance_chain(riid: &GUID) -> bool

Check whether a given IID is in the inheritance hierarchy of this interface
Source§

impl<C: ICoreWebView2_2> ProductionComInterface<C> for dyn ICoreWebView2_2

Source§

fn vtable<O: Offset>() -> Self::VTable

Get the vtable for a particular COM interface

Implementations on Foreign Types§

Source§

impl<T: ICoreWebView2_2 + ComInterface + ?Sized> ICoreWebView2_2 for ComPtr<T>

Source§

impl<T: ICoreWebView2_2 + ComInterface + ?Sized> ICoreWebView2_2 for ComRc<T>

Implementors§