public LoadErrorEventArgs(CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { Frame = frame; ErrorCode = errorCode; ErrorText = errorText; FailedUrl = failedUrl; }
public LoadErrorEventArgs(IBrowser browser, IFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { Browser = browser; Frame = frame; ErrorCode = errorCode; ErrorText = errorText; FailedUrl = failedUrl; }
private void on_load_error(cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, CefErrorCode errorCode, cef_string_t* errorText, cef_string_t* failedUrl) { CheckSelf(self); var m_browser = CefBrowser.FromNative(browser); var m_frame = CefFrame.FromNative(frame); var m_errorText = cef_string_t.ToString(errorText); var m_failedUrl = cef_string_t.ToString(failedUrl); OnLoadError(m_browser, m_frame, errorCode, m_errorText, m_failedUrl); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { //NOTE: When executing the callback in an async fashion need to check to see if it's disposed if (!callback.IsDisposed) { using (callback) { //To allow certificate //callback.Continue(true); //return true; } } return false; }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { try { //To allow certificate //callback.Continue(true); //return true; return false; } finally { callback.Dispose(); } }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { //NOTE: If you do not wish to implement this method returning false is the default behaviour // We also suggest you explicitly Dispose of the callback as it wraps an unmanaged resource. //callback.Dispose(); //return false; //NOTE: When executing the callback in an async fashion need to check to see if it's disposed if (!callback.IsDisposed) { using (callback) { //To allow certificate //callback.Continue(true); //return true; } } return false; }
bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl) { // We expect cert errors from Syncthing return true; }
protected override bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { var args = new OnCertificateErrorEventArgs(chromiumWebBrowser, browser, errorCode, requestUrl, sslInfo, callback); OnCertificateErrorEvent?.Invoke(this, args); EnsureCallbackDisposal(callback); return(args.ContinueAsync); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { var args = new OnCertificateErrorEventArgs(browserControl, browser, errorCode, requestUrl, sslInfo, callback); OnCertificateErrorEvent?.Invoke(this, args); EnsureCallbackDisposal(callback); return(args.ContinueAsync); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { if (browser.IsDisposed) { return(false); } if (!callback.IsDisposed) { using (callback) { //To allow certificate callback.Continue(true); return(true); } } return(false); }
public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { return false; }
public void OnLoadError(CefErrorCode errorCode) { this.loggingService.Debug("[OnLoadError] errorCode {0}", errorCode); pageLoadCompletionSource?.TrySetResult(false); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { // We shouldn't hit this, since IgnoreCertificateErrors is true return true; }
public LoadErrorEventArgs(CefErrorCode code,string text,string url) { _errorCode = code; _errorText = text; _failedUrl = url; }
public void OnResolveCompleted(CefErrorCode result, IList<string> resolvedIpAddresses) { taskCompletionSource.SetResult(new ResolveCallbackResult(result, resolvedIpAddresses)); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { _core.InvokeIfRequired(() => _core.OnLoadError(new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl))); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { base.OnLoadError(browser, frame, errorCode, errorText, failedUrl); if (errorCode == CefErrorCode.Aborted) return; webBrowser.OnLoadError(errorCode, errorText, failedUrl); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { this._owner.OnLoadError(frame, errorCode, errorText, failedUrl); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { _core.OnLoadError(new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl)); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { this._owner.OnLoadError(frame, errorCode, errorText, failedUrl); }
internal void OnError(CefErrorCode errorCode, string errorText, string failedUrl) { BrowserError?.Invoke(this, new BrowserErrorEventArgs(errorCode, errorText, failedUrl)); }
public bool OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl) { throw new NotImplementedException(); }
public ResolveCallbackResult(CefErrorCode result, IList <string> resolvedIpAddresses) : this() { Result = result; ResolvedIpAddresses = resolvedIpAddresses; }
bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl) { // We shouldn't hit this, since IgnoreCertificateErrors is true return true; }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { var e = new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl); _owner.InvokeIfRequired(() => _owner.OnLoadError(e)); }
public void OnLoadError(string url, CefErrorCode errorCode, string errorText) { if (LoadError != null) { LoadError(url, errorCode, errorText); } }
public virtual bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { callback.Dispose(); return(false); }
/// <summary> /// Called when the resource load for a navigation fails or is canceled. /// |errorCode| is the error code number, |errorText| is the error text and /// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h /// for complete descriptions of the error codes. /// </summary> protected virtual void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { }
/// <summary> /// Called on the UI thread to handle requests for URLs with an invalid /// SSL certificate. Return true and call CefRequestCallback::Continue() either /// in this method or at a later time to continue or cancel the request. Return /// false to cancel the request immediately. If /// CefSettings.ignore_certificate_errors is set all invalid certificates will /// be accepted without calling this method. /// </summary> protected virtual bool OnCertificateError(CefBrowser browser, CefErrorCode certError, string requestUrl, CefSslInfo sslInfo, CefRequestCallback callback) { return(false); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { return(false); }
private int on_certificate_error(cef_request_handler_t *self, cef_browser_t *browser, CefErrorCode cert_error, cef_string_t *request_url, cef_sslinfo_t *ssl_info, cef_request_callback_t *callback) { CheckSelf(self); var m_browser = CefBrowser.FromNative(browser); var m_request_url = cef_string_t.ToString(request_url); var m_ssl_info = CefSslInfo.FromNative(ssl_info); var m_callback = CefRequestCallback.FromNativeOrNull(callback); var result = OnCertificateError(m_browser, cert_error, m_request_url, m_ssl_info, m_callback); return(result ? 1 : 0); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { callback.Dispose(); return false; }
private int on_certificate_error(cef_request_handler_t* self, CefErrorCode cert_error, cef_string_t* request_url, cef_allow_certificate_error_callback_t* callback) { CheckSelf(self); var m_request_url = cef_string_t.ToString(request_url); var m_callback = CefAllowCertificateErrorCallback.FromNativeOrNull(callback); var result = OnCertificateError(cert_error, m_request_url, m_callback); return result ? 1 : 0; }
/// <summary> /// Called on the UI thread to handle requests for URLs with an invalid /// SSL certificate. Return true and call CefAllowCertificateErrorCallback:: /// Continue() either in this method or at a later time to continue or cancel /// the request. Return false to cancel the request immediately. If |callback| /// is empty the error cannot be recovered from and the request will be /// canceled automatically. If CefSettings.ignore_certificate_errors is set /// all invalid certificates will be accepted without calling this method. /// </summary> protected virtual bool OnCertificateError(CefErrorCode certError, string requestUrl, CefAllowCertificateErrorCallback callback) { return false; }
/// <summary> /// The on load error. /// </summary> /// <param name="browser"> /// The browser. /// </param> /// <param name="frame"> /// The frame. /// </param> /// <param name="errorCode"> /// The error code. /// </param> /// <param name="errorText"> /// The error text. /// </param> /// <param name="failedUrl"> /// The failed url. /// </param> protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { _browser.InvokeAsyncIfPossible(() => _browser.OnLoadError(new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl))); }
/// <summary> /// Called if the cef_request_context_t::LoadExtension request fails. |result| /// will be the error code. /// </summary> protected internal unsafe virtual void OnExtensionLoadFailed(CefErrorCode result) { }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { FRenderer.OnLoadError(frame, errorCode, failedUrl, errorText); base.OnLoadError(browser, frame, errorCode, errorText, failedUrl); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { this.core.OnLoadError(errorCode); }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, IRequestCallback callback) { try { //To allow certificate //callback.Continue(true); //return true; return(false); } finally { callback.Dispose(); } }
public void OnResolveCompleted(CefErrorCode result, IList <string> resolvedIpAddresses) { taskCompletionSource.TrySetResultAsync(new ResolveCallbackResult(result, resolvedIpAddresses)); }
private void OnWebBrowserLoadError(string failedUrl, CefErrorCode errorCode, string errorText) { // Don't display an error for downloaded files where the user aborted the download. if (errorCode == CefErrorCode.Aborted) return; var errorMessage = "<html><body><h2>Failed to load URL " + failedUrl + " with error " + errorText + " (" + errorCode + ").</h2></body></html>"; webBrowser.LoadHtml(errorMessage, failedUrl); }
/// <inheritdoc/> bool IRequestHandler.OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { return(OnCertificateError(chromiumWebBrowser, browser, errorCode, requestUrl, sslInfo, callback)); }
public BrowserErrorEventArgs(CefErrorCode errorCode, string errorText, string url) { this.ErrorCode = errorCode; this.ErrorText = errorText; this.Url = url; }
protected override bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { //NOTE: We also suggest you wrap callback in a using statement or explicitly execute callback.Dispose as callback wraps an unmanaged resource. //Example #1 //Return true and call IRequestCallback.Continue() at a later time to continue or cancel the request. //In this instance we'll use a Task, typically you'd invoke a call to the UI Thread and display a Dialog to the user //You can cast the IWebBrowser param to ChromiumWebBrowser to easily access //control, from there you can invoke onto the UI thread, should be in an async fashion Task.Run(() => { //NOTE: When executing the callback in an async fashion need to check to see if it's disposed if (!callback.IsDisposed) { using (callback) { //We'll allow the expired certificate from badssl.com if (requestUrl.ToLower().Contains("https://expired.badssl.com/")) { callback.Continue(true); } else { callback.Continue(false); } } } }); return(true); //Example #2 //Execute the callback and return true to immediately allow the invalid certificate //callback.Continue(true); //Callback will Dispose it's self once exeucted //return true; //Example #3 //Return false for the default behaviour (cancel request immediately) //callback.Dispose(); //Dispose of callback //return false; }
public LoadErrorEventArgs(string failedUrl, CefErrorCode errorCode, string errorText) { FailedUrl = failedUrl; ErrorCode = errorCode; ErrorText = errorText; }
bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { if (this.OwnerWebView.IgnoreCertificateErrors) { callback.Continue(true); return(true); } return(false); }
public override bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { //NOTE: If you do not wish to implement this method returning false is the default behaviour // We also suggest you explicitly Dispose of the callback as it wraps an unmanaged resource. //callback.Dispose(); //return false; //NOTE: When executing the callback in an async fashion need to check to see if it's disposed if (!callback.IsDisposed) { using (callback) { //To allow certificate //callback.Continue(true); //return true; } } return(false); }
/// <summary> /// Called on the UI thread to handle requests for URLs with an invalid /// SSL certificate. Return true and call CefAllowCertificateErrorCallback:: /// Continue() either in this method or at a later time to continue or cancel /// the request. Return false to cancel the request immediately. If |callback| /// is empty the error cannot be recovered from and the request will be /// canceled automatically. If CefSettings.ignore_certificate_errors is set /// all invalid certificates will be accepted without calling this method. /// </summary> protected virtual bool OnCertificateError(CefErrorCode certError, string requestUrl, CefAllowCertificateErrorCallback callback) { return(false); }
void IExtensionHandler.OnExtensionLoadFailed(CefErrorCode errorCode) { }
private void on_load_error(cef_load_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, CefErrorCode errorCode, cef_string_t *errorText, cef_string_t *failedUrl) { CheckSelf(self); var m_browser = CefBrowser.FromNative(browser); var m_frame = CefFrame.FromNative(frame); var m_errorText = cef_string_t.ToString(errorText); var m_failedUrl = cef_string_t.ToString(failedUrl); OnLoadError(m_browser, m_frame, errorCode, m_errorText, m_failedUrl); }
void IWebBrowserInternal.OnLoadError(string url, CefErrorCode errorCode, string errorText) { var handler = LoadError; if (handler != null) { handler(this, new LoadErrorEventArgs(url, errorCode, errorText)); } }
/// <summary> /// Called when the resource load for a navigation fails or is canceled. /// |errorCode| is the error code number, |errorText| is the error text and /// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h /// for complete descriptions of the error codes. /// </summary> protected virtual void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { }
public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) => true;
/// <summary> /// 证书无效时触发 /// </summary> /// <param name="chromiumWebBrowser"></param> /// <param name="browser"></param> /// <param name="errorCode"></param> /// <param name="requestUrl"></param> /// <param name="sslInfo"></param> /// <param name="callback"></param> /// <returns>返回(false:取消执行,true:继续执行)</returns> public bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) { return(true); }
protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { base.OnLoadError(browser, frame, errorCode, errorText, failedUrl); }
public OnCertificateErrorEventArgs(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) : base(browserControl, browser) { ErrorCode = errorCode; RequestUrl = requestUrl; SSLInfo = sslInfo; Callback = callback; ContinueAsync = false; // default }
bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl) { return false; }
/// <summary> /// Called if the <see cref="IRequestContext.LoadExtension"/> request fails. /// </summary> /// <param name="errorCode">error code</param> protected virtual void OnExtensionLoadFailed(CefErrorCode errorCode) { }
void IWebBrowserInternal.OnLoadError(IFrame frame, CefErrorCode errorCode, string errorText, string failedUrl) { var handler = LoadError; if (handler != null) { handler(this, new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl)); } }
public bool OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl) { return false; }