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.

How disable alert?

Post Reply
gorgor
Posts: 5
Joined: Sun Dec 08, 2024 9:09 am

How disable alert?

Post by gorgor »

Is it possible to somehow prohibit sites from using alerts.
So that pop-up windows do not appear?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How disable alert?

Post by salvadordf »

Hi,

See the CEF4Delphi/demos/JavaScript/JSDialog demo and use the TChromiumCore.OnJsdialog event to hide all JavaScript dialogs.
https://github.com/salvadordf/CEF4Delphi/blob/f0f4de8b3b5e69d0b9353a374093959712c56bb2/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas#L181

Also use the TChromiumCore.OnBeforePopup event to block all popup windows.
https://github.com/salvadordf/CEF4Delphi/blob/f0f4de8b3b5e69d0b9353a374093959712c56bb2/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas#L232
Post Reply