Hi,
I'm using CEF for hosting web based ads in my native C++ windows application.
Occasionally, an ad will misbehave and launch an annoying, unwanted and sometimes dangerous (phishing) popup. To stop this behavior I'm simply returning true in the ClientHandler::OnBeforePopup method.
Unfortunately, this is too strict since ALL popups will be disabled including any that are initiated by the user (i.e. after a mouse click)
To work around this problem I'm handling the WM_PARENTNOTIFY message for wParam == WM_LBUTTONDOWN in my window that hosts the CEF browser. The handler records the event and allows popup calls within a one second time window. As a side note, I was unable to make use of any mouse events that are serviced in the CefBrowserHost since this object is not referenced anywhere in my implementation (is that only for off screen rendered content?)
My question is this: Is there a better or more standard way to do this?
Thanks in advance,
-Dan C.