TAdvWebBrowser prevent popup - params.handled has no effect

Hello,

I found in some articles about TAdvWebBrowser (just upgraded to version 13.0.5.0 of VCL UI Pack- it shows Edge Chromium 120.0.2210.77 is successfully initialized) that it should be possible to prevent popup windows by using the NewWindowRequest event. I tried this with setting the params.handled := True; but the popup window still appears. Do I miss something?

procedure TformMain.AdvWebBrowser1NewWindowRequested(Sender: TObject; var Params: TAdvWebBrowserNewWindowRequestedParams);
begin
  Params.Handled := True;
end;

Regards
Harald

Thank you for letting us know.
This is indeed an issue and will be fixed in the next release of the TMS VCL UI Pack.
In the meantime, I've sent an incremental source update via a private message.

Hello Gjalt, thank You for the update. It works as expected. Now I'm able to prevent the popup window and route the link with this event to the main browser control.

procedure TformMain.AdvWebBrowser1NewWindowRequested(Sender: TObject; var Params: TAdvWebBrowserNewWindowRequestedParams);
begin
  Params.Handled := True;
  AdvWebBrowser1.Navigate(Params.URL);
end;

2 Likes