OnNewWindowRequested - cWebView2Browser

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

Type: Event

Parameters: String sUrl Boolean bUserInitiated Boolean ByRef bHandled tWebView2_WindowFeatures requestedFeatures Handle ByRef hoNewWindow

ParameterDescription
sUrlURL to be opened in the window
bUserInitiatedIndicates if a user action initiated this request
bHandled (ByRef)Set to True if the opening of the new window is handled in DataFlex code
requestedFeaturesStruct indicating details of the new window request
hoNewWindow (ByRef)Set to the object handle of a new cWebView2Browser when handling the request manually


Syntax
Procedure OnNewWindowRequested String sUrl Boolean bUserInitiated Boolean ByRef bHandled tWebView2_WindowFeatures requestedFeatures Handle ByRef 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).