chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.09k stars 450 forks source link

chrome: CefJSDialogHandler::OnJSDialog() is not called on chrome runtime #3702

Closed aYutaSekiguchi closed 3 weeks ago

aYutaSekiguchi commented 1 month ago

Describe the bug

CefJSDialogHandler::OnJSDialog() is not called on chrome runtime

To Reproduce Steps to reproduce the behavior:

  1. Implement SimpleHandler::OnJSDialog().
    
    diff --git a/tests/cefsimple/simple_handler.cc b/tests/cefsimple/simple_handler.cc
    index 41d0841a4..601920b10 100644
    --- a/tests/cefsimple/simple_handler.cc
    +++ b/tests/cefsimple/simple_handler.cc
    @@ -10,6 +10,7 @@
    #include "include/base/cef_callback.h"
    #include "include/cef_app.h"
    #include "include/cef_parser.h"
    +#include "include/base/cef_logging.h"
    #include "include/views/cef_browser_view.h"
    #include "include/views/cef_window.h"
    #include "include/wrapper/cef_closure_task.h"
    @@ -131,6 +132,17 @@ void SimpleHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
    frame->LoadURL(GetDataURI(ss.str(), "text/html"));
    }

+bool SimpleHandler::OnJSDialog(CefRefPtr browser,


2. Load https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert with cefsimple and click `Try it` button. 
3. OnJSDialog() is not called.

**Expected behavior**
The log like `[0522/171624.446730:INFO:simple_handler.cc(142)] OnJSDialog` should be displayed when the button `Try it` is clicked.

**Versions (please complete the following information):**
 - OS: Ubuntu 22.04
 - CEF Version: 125.0.6422.41

**Additional context**
> Does the problem reproduce with the cefclient or cefsimple sample application at the same version? 

YES

> Does the problem reproduce with Google Chrome at the same version?

NO
magreenblatt commented 1 month ago

Related PR: https://bitbucket.org/chromiumembedded/cef/pull-requests/761