Skip to content

OnNewWindowRequested - cWebView2Browser

Sent when the page (via a script or a link) requests a new browser window

Type: Event

Parameters

Parameter Type Description
sUrl String URL to be opened in the window
bUserInitiated Boolean Indicates if a user action initiated this request
ByRef bHandled Boolean Set to True if the opening of the new window is handled in DataFlex code
requestedFeatures tWebView2_WindowFeatures Struct indicating details of the new window request
ByRef hoNewWindow Handle Set to the object handle of a new cWebView2Browser when handling the request manually

Syntax

Procedure OnNewWindowRequested String sUrl Boolean bUserInitiated ByRef Boolean bHandled tWebView2_WindowFeatures requestedFeatures ByRef Handle hoNewWindow

Description

This message is sent when the page (via a script or a link) requests a new browser window.

By default, the WebView2 control will open a new window after this event. Set bHandled to True to override the default behavior.

Set hoNewWindow to a new cWebView2Browser window to set op the connection between the top level window and the newly opened window so that the top level window can communicate with the new window as usual (using JavaScript).