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
34 lines (28 loc) · 1 KB
/
JsDialogHandler.cs
File metadata and controls
34 lines (28 loc) · 1 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
27
28
29
30
31
32
33
34
namespace CefSharp.Example
{
public class JsDialogHandler : IJsDialogHandler
{
public bool OnJSAlert(IWebBrowser browser, string url, string message)
{
return false;
}
public bool OnJSConfirm(IWebBrowser browser, string url, string message, out bool retval)
{
retval = false;
return false;
}
public bool OnJSPrompt(IWebBrowser browser, string url, string message, string defaultValue, out bool retval, out string result)
{
retval = false;
result = null;
return false;
}
public bool OnJSBeforeUnload(IWebBrowser browser, string message, bool isReload, out bool allowUnload)
{
//NOTE: Setting allowUnload to false will cancel the unload request
allowUnload = false;
//NOTE: Returning false will trigger the default behaviour, you need to return true to handle yourself.
return false;
}
}
}