Prevent download Twebbrowser Delphi

Asked

Viewed 335 times

0

I have 1 Webbrowser that when loaded a URL he must load an image according to a query in the BD. It happens that the first time the request is made it opens the screen to save this image, if close this window it proceeds normally. Some way to cancel the donwload?

1 answer

1

At the event OnDownloadBegin you can program a Abort. This way it will stop the download, however, one should be careful with this procedure, in some cases it may stop the page loading.

procedure TForm5.WebBrowser1DownloadBegin(Sender: TObject);
begin
  Abort;
end;

I don’t particularly use the TWebBrowser (which is an instance of Internet Explorer (6x if not mistaken)) that does not support HTML5 and bad in the processing of js.

Today I am using the Chromium, I recommend giving a research on the subject!

  • I’ve been told about this Chromium. I don’t know if it’s native to Delphi in the latest versions but I use Delphi 10 Seattle and it has this component.

  • It’s an Open Source. It’s not native!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.