Windowless popup creates win (OnBeforePopup not called)

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Windowless popup creates win (OnBeforePopup not called)

Postby romariorios » Wed Jun 15, 2016 9:05 pm

Hello.

In my application, I overrode OnBeforePopup so that all new popups became windowless:

Code: Select all
bool SimpleHandler::OnBeforePopup(
  CefRefPtr<CefBrowser> browser,
  CefRefPtr<CefFrame>,
  const CefString &,
  const CefString &,
  CefLifeSpanHandler::WindowOpenDisposition,
  bool,
  const CefPopupFeatures &,
  CefWindowInfo &winInfo,
  CefRefPtr<CefClient> &,
  CefBrowserSettings &,
  bool *)
{
  winInfo.SetAsWindowless(browser->GetHost()->GetWindowHandle(), false);

  return false;
}


However, there are some cases where a popup window still shows up. This page(EDIT: no longer available, archive version down in the replies), for example (careful, scam). If you click it soon enough, a new window shows up, apparently as a result of an event listener, listening to mousedown and touchstart on document. Any idea why this happens?
Last edited by romariorios on Wed Sep 14, 2016 9:44 pm, edited 2 times in total.
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil

Re: Windowless popup creates new window

Postby amaitland » Wed Jun 15, 2016 11:06 pm

Is `OnBeforePopup` being called for your scam page?

Typically I'd return true to cancel loading a popup, not just try and make them hidden.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Windowless popup creates new window

Postby romariorios » Thu Jun 16, 2016 9:10 am

amaitland wrote:Is `OnBeforePopup` being called for your scam page?

It seems it isn't. Only OnAfterCreated is being called when that happens.

This is weird. If I click the "How to use this faucet?" text before the page loads, OnBeforePopup isn't called and the popup window shows up. But, if I wait long enough (something like 5-10 secs), OnBeforePopup gets called properly and the window gets hidden. Any idea why this happens?

EDIT: By the way, the above applies regardless of me returning true or false from OnBeforePopup.
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil

Re: Windowless popup creates win (OnBeforePopup not called)

Postby romariorios » Tue Jul 19, 2016 6:54 pm

Can I bump this up? It's been a month and I still have this problem.
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil

Re: Windowless popup creates win (OnBeforePopup not called)

Postby Czarek » Wed Jul 20, 2016 2:24 am

Can you reproduce issue in cefclient? Basic info like OS/CEF versions are missing.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Windowless popup creates win (OnBeforePopup not called)

Postby romariorios » Wed Aug 31, 2016 6:43 pm

Czarek wrote:Can you reproduce issue in cefclient? Basic info like OS/CEF versions are missing.

I'll try to reproduce it. The issue was noticed in Windows 10, CEF 2623.
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil

Re: Windowless popup creates win (OnBeforePopup not called)

Postby amaitland » Wed Aug 31, 2016 7:02 pm

2623 is no longer supported, best to use 2785
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Windowless popup creates win (OnBeforePopup not called)

Postby romariorios » Mon Sep 12, 2016 4:15 pm

amaitland wrote:2623 is no longer supported, best to use 2785

How can I check that the cause for this is fixed in the latest version (currently 2840)?
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil

Re: Windowless popup creates win (OnBeforePopup not called)

Postby romariorios » Wed Sep 14, 2016 9:42 pm

The page is currently offline (probably due to abuse). I still have it archived here, if anyone wants to test this: https://www.dropbox.com/s/ebmh92abykjzxgs/bluebtc.zip
romariorios
Mentor
 
Posts: 50
Joined: Thu Apr 30, 2015 6:13 am
Location: Brazil


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 112 guests