forked from CCBlueX/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSDialogHandler.java
More file actions
26 lines (23 loc) · 1.09 KB
/
JSDialogHandler.java
File metadata and controls
26 lines (23 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package tests.detailed.handler;
import org.cef.browser.CefBrowser;
import org.cef.callback.CefJSDialogCallback;
import org.cef.handler.CefJSDialogHandlerAdapter;
import org.cef.misc.BoolRef;
public class JSDialogHandler extends CefJSDialogHandlerAdapter {
@Override
public boolean onJSDialog(CefBrowser browser, String origin_url, JSDialogType dialog_type,
String message_text, String default_prompt_text, CefJSDialogCallback callback,
BoolRef suppress_message) {
if (message_text.equalsIgnoreCase("Never displayed")) {
suppress_message.set(true);
System.out.println(
"The " + dialog_type + " from origin \"" + origin_url + "\" was suppressed.");
System.out.println(
" The content of the suppressed dialog was: \"" + message_text + "\"");
}
return false;
}
}