The OpenD Programming Language

ICoreWebView2NewWindowRequestedEventArgs2

Undocumented in source.
version(Windows && inline_webview2_bindings && all)
interface ICoreWebView2NewWindowRequestedEventArgs2 : ICoreWebView2NewWindowRequestedEventArgs {
static const
GUID iid;
}

Members

Functions

get_Name
HRESULT get_Name(LPWSTR* value)

Gets the name of the new window. This window can be created via window.open(url, windowName), where the windowName parameter corresponds to Name property. If no windowName is passed to window.open, then the Name property will be set to an empty string. Additionally, if window is opened through other means, such as <a target="windowName">...</a> or <iframe name="windowName">...</iframe>, then the Name property will be set accordingly. In the case of target=_blank, the Name property will be an empty string. Opening a window via ctrl+clicking a link would result in the Name property being set to an empty string.

Inherited Members

From ICoreWebView2NewWindowRequestedEventArgs

get_Uri
HRESULT get_Uri(LPWSTR* uri)

The target uri of the new window requested.

put_NewWindow
HRESULT put_NewWindow(ICoreWebView2 newWindow)

Sets a CoreWebView2 as a result of the NewWindowRequested event. Provides a WebView as the target for a window.open() from inside the requesting WebView. If this is set, the top-level window of this WebView is returned as the opened WindowProxy

to the opener script. If this is not set, then Handled is checked to determine behavior for NewWindowRequested event. CoreWebView2 provided in the NewWindow property must be on the same Environment as the opener WebView and should not have been navigated previously. Don't use methods that cause navigation or interact with the DOM on this CoreWebView2 until the target content has loaded. Setting event handlers, changing Settings properties, or other methods are fine to call. Changes to settings should be made before put_NewWindow is called to ensure that those settings take effect for the newly setup WebView. 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.

get_NewWindow
HRESULT get_NewWindow(ICoreWebView2* newWindow)

Gets the new window.

put_Handled
HRESULT put_Handled(BOOL handled)

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.

get_Handled
HRESULT get_Handled(BOOL* handled)

Gets whether the NewWindowRequested event is handled by host.

get_IsUserInitiated
HRESULT get_IsUserInitiated(BOOL* isUserInitiated)

TRUE when the new window request was initiated through a user gesture. Examples of user initiated requests are:

GetDeferral
HRESULT GetDeferral(ICoreWebView2Deferral* deferral)

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.

get_WindowFeatures
HRESULT get_WindowFeatures(ICoreWebView2WindowFeatures* value)

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

Meta