Page 1 of 1

WVBrowser1NewWindowRequested

Posted: Mon Nov 04, 2024 8:34 pm
by sodlf159
procedure TMainForm.WVBrowser1NewWindowRequested(Sender: TObject;
const aWebView: ICoreWebView2;
const aArgs: ICoreWebView2NewWindowRequestedEventArgs);
var
uri: PWideChar;
begin
aArgs.Get_uri(uri);
aArgs.Set_NewWindow(ICoreWebView2(aWebView));
aArgs.Set_NewWindow(aWebView);
aArgs.Set_Handled(1);

or

var
TempArgs : TCoreWebView2NewWindowRequestedEventArgs;
begin
TempArgs := TCoreWebView2NewWindowRequestedEventArgs.Create(aArgs);
WVBrowser1.Navigate(TempArgs.URI);
TempArgs.Handled := True;
TempArgs.Free;



Set New Window is recommended.