-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathJsDialogHandler.cs
More file actions
36 lines (29 loc) · 1.33 KB
/
JsDialogHandler.cs
File metadata and controls
36 lines (29 loc) · 1.33 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
35
36
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp.Example.Handlers
{
public class JsDialogHandler : IJsDialogHandler
{
bool IJsDialogHandler.OnJSDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage)
{
return false;
}
bool IJsDialogHandler.OnBeforeUnloadDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string message, bool isReload, IJsDialogCallback callback)
{
//Custom implementation would look something like
// - Create/Show dialog on UI Thread
// - execute callback once user has responded
// - callback.Continue(true);
// - return true
//NOTE: Returning false will trigger the default behaviour, no need to execute the callback if you return false.
return false;
}
void IJsDialogHandler.OnResetDialogState(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
void IJsDialogHandler.OnDialogClosed(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
}
}