Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

WVBrowser1NewWindowRequested

Post Reply
sodlf159
Posts: 73
Joined: Thu Nov 09, 2023 1:55 pm

WVBrowser1NewWindowRequested

Post 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.
Post Reply