protected override bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref bool noJavascriptAccess) { var eventArgs = new BeforePopupEventArgs(frame, targetUrl, targetFrameName, popupFeatures, windowInfo, client, settings, noJavascriptAccess); m_browser.InvokeAsyncIfPossible(() => m_browser.OnBeforePopup(eventArgs)); client = eventArgs.Client; noJavascriptAccess = eventArgs.NoJavascriptAccess; return(eventArgs.Handled); }
protected override bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref CefDictionaryValue extraInfo, ref bool noJavascriptAccess) { _browser.InvokeAsyncIfPossible(() => _browser.OnBeforePopup(new BeforePopupEventArgs(frame, targetUrl, targetFrameName))); var isUrlExternal = _config?.UrlSchemes?.IsUrlRegisteredExternalScheme(targetUrl); if (isUrlExternal.HasValue && isUrlExternal.Value) { RegisteredExternalUrl.Launch(targetUrl); } var isUrlCommand = _config?.UrlSchemes?.IsUrlRegisteredCommandScheme(targetUrl); if (isUrlCommand.HasValue && isUrlCommand.Value) { _commandTaskRunner.RunAsync(targetUrl); } return(true); }