diff --git a/native/atom_cef_client.h b/native/atom_cef_client.h index 1ca42de70..1a180a1cb 100644 --- a/native/atom_cef_client.h +++ b/native/atom_cef_client.h @@ -16,6 +16,7 @@ class AtomCefClient : public CefClient, public CefContextMenuHandler, public CefDisplayHandler, + public CefJSDialogHandler, public CefKeyboardHandler, public CefLifeSpanHandler, public CefLoadHandler, @@ -33,6 +34,9 @@ class AtomCefClient : public CefClient, virtual CefRefPtr GetDisplayHandler() OVERRIDE { return this; } + virtual CefRefPtr GetJSDialogHandler() { + return this; + } virtual CefRefPtr GetKeyboardHandler() OVERRIDE { return this; } @@ -65,6 +69,14 @@ class AtomCefClient : public CefClient, int line) OVERRIDE; + // CefJsDialogHandlerMethods + virtual bool OnBeforeUnloadDialog(CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) { + callback->Continue(true, ""); + return true; + } // CefKeyboardHandler methods virtual bool OnKeyEvent(CefRefPtr browser,