How do I block pop-ups asking me to select an app from appearing?
Chrome itself is currently updating its version.
A pop-up window will appear allowing you to select the page and open the link app in the format.
I want to block this.
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.
block pop-ups plz
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: block pop-ups plz
See the SimpleBrowser2 demo :
https://github.com/salvadordf/CEF4Delphi/blob/00bf20f147679db82d37cc69f37ff8663f90f2de/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas#L143
Implement TChromiumCore.OnBeforePopup and TChromiumCore.OnOpenUrlFromTab
Set Result to TRUE when "targetDisposition" has any of these values : CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW
https://github.com/salvadordf/CEF4Delphi/blob/00bf20f147679db82d37cc69f37ff8663f90f2de/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas#L143
Implement TChromiumCore.OnBeforePopup and TChromiumCore.OnOpenUrlFromTab
Set Result to TRUE when "targetDisposition" has any of these values : CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW
Re: block pop-ups plz
Thanks. Is there a similar function for WebView4?
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: block pop-ups plz
The KioskBrowser demo in WebView4Delphi shows how to block popup windows using the TWVBrowser.OnNewWindowRequested event :
https://github.com/salvadordf/WebView4Delphi/blob/b0cfcb2f551bb589e4ce6456b847d9e2aee2acc0/demos/Delphi_VCL/KioskBrowser/uKioskBrowser.pas#L179
Create a TCoreWebView2NewWindowRequestedEventArgs instance with "aArgs" and set its Handled property to True.
Read the code comments about TCoreWebView2NewWindowRequestedEventArgs for all the details.
https://github.com/salvadordf/WebView4Delphi/blob/b0cfcb2f551bb589e4ce6456b847d9e2aee2acc0/demos/Delphi_VCL/KioskBrowser/uKioskBrowser.pas#L179
Create a TCoreWebView2NewWindowRequestedEventArgs instance with "aArgs" and set its Handled property to True.
Read the code comments about TCoreWebView2NewWindowRequestedEventArgs for all the details.