by yhe » Mon Apr 08, 2024 8:06 am
Thanks for your reply.
I have a JcefControl class that creates a CefClient and adds the LifeSpanHandler to it: cefClient.addLifeSpanHandler(new JcefLifeSpanHandler(this));
In JcefLifeSpanHandler I implement the onBeforePopup
public boolean onBeforePopup(CefBrowser browser, CefFrame frame, String targetUrl, String targetFrameName) {
jcefCntrl.createBrowser(targetUrl, targetFrameName);
return true;
}
In JcefControl I have createBrowser method:
public void createBrowser(String url, String title) {
CefBrowser browser = cefClient.createBrowser(url, useOSR, isTransparent);
}
First I call the createBrowser to open the first page, and that is fine. But if I click a URL on the first created browser page, window.open(secondURL) gets called which triggers the createBrowser called from callback onBeforePopup, even it returns true, I get the error popup saying cannot open but the browser acturally is created and opened.
I just wonder is any way to get rid of the popup.
Thank you very much.