void SimpleHandler::ShowMainWindow() {
if (!CefCurrentlyOn(TID_UI)) {
// Execute on the UI thread.
diff --git a/tests/cefsimple/simple_handler.h b/tests/cefsimple/simple_handler.h
index ea9e344d5..409ccad68 100644
--- a/tests/cefsimple/simple_handler.h
+++ b/tests/cefsimple/simple_handler.h
@@ -12,7 +12,8 @@
class SimpleHandler : public CefClient,
public CefDisplayHandler,
public CefLifeSpanHandler,
// Request that all existing browser windows close.
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
Describe the bug
CefJSDialogHandler::OnJSDialog() is not called on chrome runtime
To Reproduce Steps to reproduce the behavior:
+bool SimpleHandler::OnJSDialog(CefRefPtr browser,
const CefString& origin_url,
JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,
CefRefPtr callback,
bool& suppress_message) {
LOG(INFO) << func;
return false; +}
void SimpleHandler::ShowMainWindow() { if (!CefCurrentlyOn(TID_UI)) { // Execute on the UI thread. diff --git a/tests/cefsimple/simple_handler.h b/tests/cefsimple/simple_handler.h index ea9e344d5..409ccad68 100644 --- a/tests/cefsimple/simple_handler.h +++ b/tests/cefsimple/simple_handler.h @@ -12,7 +12,8 @@ class SimpleHandler : public CefClient, public CefDisplayHandler, public CefLifeSpanHandler,
public CefLoadHandler {
public CefLoadHandler,
public CefJSDialogHandler { public: explicit SimpleHandler(bool is_alloy_style); ~SimpleHandler() override; @@ -24,6 +25,7 @@ class SimpleHandler : public CefClient, CefRefPtr GetDisplayHandler() override { return this; }
CefRefPtr GetLifeSpanHandler() override { return this; }
CefRefPtr GetLoadHandler() override { return this; }
CefRefPtr GetJSDialogHandler() override { return this; }
// CefDisplayHandler methods: void OnTitleChange(CefRefPtr browser,
@@ -41,6 +43,15 @@ class SimpleHandler : public CefClient,
const CefString& errorText,
const CefString& failedUrl) override;
// CefJSDialogHandler methods:
bool OnJSDialog(CefRefPtr browser,
const CefString& origin_url,
JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,
CefRefPtr callback,
bool& suppress_message) override;
void ShowMainWindow();
// Request that all existing browser windows close.