IJsDialogHandler.OnJSBeforeUnload Method |
Version 57.0.0
When leaving the page a Javascript dialog is displayed asking for user confirmation.
Returning True allows you to implement a custom dialog or programatically handle.
To cancel the unload return True and set allowUnload to False.
Namespace: CefSharpAssembly: CefSharp (in CefSharp.dll) Version: 57.0.0.0 (57.0.0.0)
Syntaxbool OnJSBeforeUnload(
IWebBrowser browserControl,
IBrowser browser,
string message,
bool isReload,
IJsDialogCallback callback
)
bool OnJSBeforeUnload(
IWebBrowser^ browserControl,
IBrowser^ browser,
String^ message,
bool isReload,
IJsDialogCallback^ callback
)
Parameters
- browserControl
- Type: CefSharp.IWebBrowser
the browser control - browser
- Type: CefSharp.IBrowser
the browser object - message
- Type: System.String
message (optional) - isReload
- Type: System.Boolean
indicates a page reload - callback
- Type: CefSharp.IJsDialogCallback
Callback can be executed inline or in an async fashion
Return Value
Type:
BooleanReturn false to use the default dialog implementation otherwise return true to handle
See Also