Esempio n. 1
0
		public LoadErrorEventArgs(CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
		{
			Frame = frame;
			ErrorCode = errorCode;
			ErrorText = errorText;
			FailedUrl = failedUrl;
		}
Esempio n. 2
0
 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);
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        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;
 }
Esempio n. 7
0
 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);
        }
Esempio n. 9
0
        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;
 }
Esempio n. 12
0
        public void OnLoadError(CefErrorCode errorCode)
        {
            this.loggingService.Debug("[OnLoadError] errorCode {0}", errorCode);

            pageLoadCompletionSource?.TrySetResult(false);
        }
Esempio n. 13
0
 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;
 }
Esempio n. 14
0
 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));
 }
Esempio n. 16
0
		protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
		{
			_core.InvokeIfRequired(() => _core.OnLoadError(new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl)));
		}
Esempio n. 17
0
 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);
 }
Esempio n. 18
0
 protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
 {
     this._owner.OnLoadError(frame, errorCode, errorText, failedUrl);
 }
Esempio n. 19
0
 protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
 {
     _core.OnLoadError(new LoadErrorEventArgs(frame, errorCode, errorText, failedUrl));
 }
Esempio n. 20
0
 protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
 {
     this._owner.OnLoadError(frame, errorCode, errorText, failedUrl);
 }
Esempio n. 21
0
 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;
 }
Esempio n. 24
0
 bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl)
 {
     // We shouldn't hit this, since IgnoreCertificateErrors is true
     return true;
 }
Esempio n. 25
0
        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));
        }
Esempio n. 26
0
 public void OnLoadError(string url, CefErrorCode errorCode, string errorText)
 {
     if (LoadError != null)
     {
         LoadError(url, errorCode, errorText);
     }
 }
Esempio n. 27
0
 public virtual bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl,
                                        ISslInfo sslInfo, IRequestCallback callback)
 {
     callback.Dispose();
     return(false);
 }
Esempio n. 28
0
 /// <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)
 {
 }
Esempio n. 29
0
 /// <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);
 }
Esempio n. 30
0
 bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode,
                                         string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
 {
     return(false);
 }
Esempio n. 31
0
        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;
 }
Esempio n. 35
0
 /// <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)));
 }
Esempio n. 36
0
 /// <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)
 {
 }
Esempio n. 37
0
 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);
 }
Esempio n. 38
0
 protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
 {
     this.core.OnLoadError(errorCode);
 }
Esempio n. 39
0
        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();
            }
        }
Esempio n. 40
0
 public void OnResolveCompleted(CefErrorCode result, IList <string> resolvedIpAddresses)
 {
     taskCompletionSource.TrySetResultAsync(new ResolveCallbackResult(result, resolvedIpAddresses));
 }
Esempio n. 41
0
        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);
        }
Esempio n. 42
0
 /// <inheritdoc/>
 bool IRequestHandler.OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl,
                                         ISslInfo sslInfo, IRequestCallback callback)
 {
     return(OnCertificateError(chromiumWebBrowser, browser, errorCode, requestUrl, sslInfo, callback));
 }
Esempio n. 43
0
 public BrowserErrorEventArgs(CefErrorCode errorCode, string errorText, string url)
 {
     this.ErrorCode = errorCode;
     this.ErrorText = errorText;
     this.Url       = url;
 }
Esempio n. 44
0
        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;
        }
Esempio n. 45
0
 public LoadErrorEventArgs(string failedUrl, CefErrorCode errorCode, string errorText)
 {
     FailedUrl = failedUrl;
     ErrorCode = errorCode;
     ErrorText = errorText;
 }
Esempio n. 46
0
 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);
 }
Esempio n. 47
0
        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);
        }
Esempio n. 48
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);
 }
Esempio n. 49
0
 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);
        }
Esempio n. 51
0
 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)
 {
 }
Esempio n. 53
0
 public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) =>
 true;
Esempio n. 54
0
 /// <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);
 }
Esempio n. 55
0
 protected override void OnLoadError(CefBrowser browser, CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
 {
     base.OnLoadError(browser, frame, errorCode, errorText, failedUrl);
 }
Esempio n. 56
0
        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
        }
Esempio n. 57
0
 bool IRequestHandler.OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl)
 {
     return false;
 }
Esempio n. 58
0
 /// <summary>
 /// Called if the <see cref="IRequestContext.LoadExtension"/> request fails.
 /// </summary>
 /// <param name="errorCode">error code</param>
 protected virtual void OnExtensionLoadFailed(CefErrorCode errorCode)
 {
 }
Esempio n. 59
0
 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));
     }
 }
Esempio n. 60
0
 public bool OnCertificateError(IWebBrowser browser, CefErrorCode errorCode, string requestUrl)
 {
     return false;
 }