ICoreWebView2NewWindowRequestedEventArgs

Trait ICoreWebView2NewWindowRequestedEventArgs 

Source
pub trait ICoreWebView2NewWindowRequestedEventArgs: IUnknown {
    // Required methods
    unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT;
    unsafe fn put_new_window(
        &self,
        new_window: *mut *mut ICoreWebView2VTable,
    ) -> HRESULT;
    unsafe fn get_new_window(
        &self,
        new_window: *mut *mut *mut ICoreWebView2VTable,
    ) -> HRESULT;
    unsafe fn put_handled(&self, handled: BOOL) -> HRESULT;
    unsafe fn get_handled(&self, handled: *mut BOOL) -> HRESULT;
    unsafe fn get_is_user_initiated(
        &self,
        is_user_initiated: *mut BOOL,
    ) -> HRESULT;
    unsafe fn get_deferral(
        &self,
        deferral: *mut *mut *mut ICoreWebView2DeferralVTable,
    ) -> HRESULT;
    unsafe fn get_window_features(
        &self,
        value: *mut *mut *mut ICoreWebView2WindowFeaturesVTable,
    ) -> HRESULT;
}
Expand description

Event args for the NewWindowRequested event. The event is run when content inside webview requested to a open a new window (through window.open() and so on).

Required Methods§

Source

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

The target uri of the new window requested.

Source

unsafe fn put_new_window( &self, new_window: *mut *mut ICoreWebView2VTable, ) -> HRESULT

Sets a CoreWebView2 as a result of the NewWindowRequested event. If the NewWindow is set, the top-level window returns as the opened WindowProxy. The NewWindow property should be set to a CoreWebView2 that has not been navigated previously. Don’t use methods that cause navigation or interact with the DOM on this CoreWebView2. Setting event handlers, changing Settings properties, or other methods are fine to call. Once the NewWindow is set the underlying web contents of this CoreWebView2 will be replaced and navigated as appropriate for the new window. After setting new window it cannot be changed and error will be return otherwise.

The methods which should affect the new web contents like AddScriptToExecuteOnDocumentCreated and add_WebResourceRequested have to be called after setting NewWindow.

Source

unsafe fn get_new_window( &self, new_window: *mut *mut *mut ICoreWebView2VTable, ) -> HRESULT

Gets the new window.

Source

unsafe fn put_handled(&self, handled: BOOL) -> HRESULT

Sets whether the NewWindowRequested event is handled by host. If this is FALSE and no NewWindow is set, the WebView opens a popup window and it returns as opened WindowProxy. If set to TRUE and no NewWindow is set for window.open, the opened WindowProxy is for an testing window object and no window loads. The default value is FALSE.

Source

unsafe fn get_handled(&self, handled: *mut BOOL) -> HRESULT

Gets whether the NewWindowRequested event is handled by host.

Source

unsafe fn get_is_user_initiated(&self, is_user_initiated: *mut BOOL) -> HRESULT

TRUE when the new window request was initiated through a user gesture such as selecting an anchor tag with target. The Microsoft Edge popup blocker is disabled for WebView so the app is able to use this flag to block non-user initiated popups.

Source

unsafe fn get_deferral( &self, deferral: *mut *mut *mut ICoreWebView2DeferralVTable, ) -> HRESULT

Obtain an ICoreWebView2Deferral object and put the event into a deferred state. Use the ICoreWebView2Deferral object to complete the window open request at a later time. While this event is deferred the opener window returns a WindowProxy to an un-navigated window, which navigates when the deferral is complete.

Source

unsafe fn get_window_features( &self, value: *mut *mut *mut ICoreWebView2WindowFeaturesVTable, ) -> HRESULT

Window features specified by the window.open. The features should be considered for positioning and sizing of new webview windows.

Trait Implementations§

Source§

impl ComInterface for dyn ICoreWebView2NewWindowRequestedEventArgs

Source§

const IID: IID = IID_ICORE_WEB_VIEW2_NEW_WINDOW_REQUESTED_EVENT_ARGS

The associated id for this interface
Source§

type VTable = ICoreWebView2NewWindowRequestedEventArgsVTable

A COM compatible V-Table
Source§

type Super = dyn IUnknown

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: ICoreWebView2NewWindowRequestedEventArgs> ProductionComInterface<C> for dyn ICoreWebView2NewWindowRequestedEventArgs

Source§

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

Get the vtable for a particular COM interface

Implementations on Foreign Types§

Source§

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

Source§

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

Source§

unsafe fn put_new_window( &self, new_window: *mut *mut ICoreWebView2VTable, ) -> HRESULT

Source§

unsafe fn get_new_window( &self, new_window: *mut *mut *mut ICoreWebView2VTable, ) -> HRESULT

Source§

unsafe fn put_handled(&self, handled: BOOL) -> HRESULT

Source§

unsafe fn get_handled(&self, handled: *mut BOOL) -> HRESULT

Source§

unsafe fn get_is_user_initiated(&self, is_user_initiated: *mut BOOL) -> HRESULT

Source§

unsafe fn get_deferral( &self, deferral: *mut *mut *mut ICoreWebView2DeferralVTable, ) -> HRESULT

Source§

unsafe fn get_window_features( &self, value: *mut *mut *mut ICoreWebView2WindowFeaturesVTable, ) -> HRESULT

Source§

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

Source§

unsafe fn get_uri(&self, uri: *mut LPWSTR) -> HRESULT

Source§

unsafe fn put_new_window( &self, new_window: *mut *mut ICoreWebView2VTable, ) -> HRESULT

Source§

unsafe fn get_new_window( &self, new_window: *mut *mut *mut ICoreWebView2VTable, ) -> HRESULT

Source§

unsafe fn put_handled(&self, handled: BOOL) -> HRESULT

Source§

unsafe fn get_handled(&self, handled: *mut BOOL) -> HRESULT

Source§

unsafe fn get_is_user_initiated(&self, is_user_initiated: *mut BOOL) -> HRESULT

Source§

unsafe fn get_deferral( &self, deferral: *mut *mut *mut ICoreWebView2DeferralVTable, ) -> HRESULT

Source§

unsafe fn get_window_features( &self, value: *mut *mut *mut ICoreWebView2WindowFeaturesVTable, ) -> HRESULT

Implementors§