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.

popups in fmxchromium browser

Post Reply
padamjain
Posts: 23
Joined: Thu Jan 17, 2019 12:36 pm

popups in fmxchromium browser

Post by padamjain »

Hi,

I have implemented FMXChromium in my firemonkey application.
I have web page with pop ups, when i click on buttons the pop up should open, which is not happening in my case.
any advise ? is it possible to have a popup ?

Regards
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: popups in fmxchromium browser

Post by salvadordf »

There are 2 ways to handle popup windows :
  • Letting CEF create all the popup windows.
  • Manage the popup windows yourself.
The MiniBroser demo lets CEF create the popup windows and the PopupBrowser and PopupBrowser2 demos create the popup windows manually.

PopupBrowser uses popup windows in OSR mode and PopupBrowser2 uses popup windows in normal mode.

Creating popup windows is complicated because CEF executes the events in threads and the VCL needs to create and destroy all controls in the main thread. Read the code comments in those demos for more details.

The rest of the demos block all new popups, tabs and windows to keep them as simple as possible.

If you need an easy way to have popup windows I would suggest you use the MiniBrowser method. Use the TChromium.OnBeforePopup to block any unwanted windows and add TChromium.IsSameBrowser(browser) calls to the TChromium events because CEF will use the same event procedures for the main browser and all the popup browsers.
Post Reply