Need browser's Popups control

Having problems with building or using the JCEF Java binding? Ask your questions here.

Need browser's Popups control

Postby julia » Fri Oct 07, 2016 2:46 am

Hello,

Is it any possibility to control popups, or even better for me to open popup content in my own JCef browser instance.
I'm using browser to open email(like gmail.com or yahoo.com) in JCef Browser. There are several cases that lead to popup opening.

I'm handling addLifeSpanHandler onBefore Popup.
I was trying to use "newUrl" parameter and load it in new browser window. But "newUrl" usually doesn't redirect to correct page, or is "about:blank".

Code: Select all
client_.addLifeSpanHandler(new CefLifeSpanHandler() {
         
         @Override
         public boolean onBeforePopup(CefBrowser browser, String newUrl, String arg2) {
                                // Here i was trying to use "newUrl" parameter and load it in new browser window.
            return true;
         }
         
         @Override
         public void onBeforeClose(CefBrowser arg0) {
            //System.out.println("PRESSED CLOSE WINDOW.....");
            
         }
         
         @Override
         public void onAfterCreated(CefBrowser browser) {      
            //System.out.println("onAfterCreated URL: " + browser.isPopup() + " " + browser.getURL());            
         }
         
         @Override
         public boolean doClose(CefBrowser arg0) {
            return false;
         }
});


Please, suggest some solution or workaround, because I stuck with it and it's a real impediment for my project.

Hope to hear some advices soon..
Thanks,
Julia
julia
Newbie
 
Posts: 3
Joined: Thu Sep 15, 2016 7:03 am

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 5 guests