以下是CefSharp示例(link)中OnBeforeUnloadDialog的处理程序方法。 用户响应后执行回调是什么意思?
bool IJsDialogHandler.OnBeforeUnloadDialog(IWebBrowser browserControl, 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;
}