forked from cefsharp/CefSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsDialogHandler.cs
More file actions
19 lines (17 loc) · 804 Bytes
/
JsDialogHandler.cs
File metadata and controls
19 lines (17 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
namespace CefSharp.Example
{
public class JsDialogHandler : IJsDialogHandler
{
public bool OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, string acceptLang, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage)
{
return false;
}
public bool OnJSBeforeUnload(IWebBrowser browserControl, IBrowser browser, string message, bool isReload, IJsDialogCallback callback)
{
//NOTE: No need to execute the callback if you return false
// callback.Continue(true);
//NOTE: Returning false will trigger the default behaviour, you need to return true to handle yourself.
return false;
}
}
}