public void OnUncaughtException(IWebBrowser browserControl, IBrowser browser, IFrame frame, CefSharp.JavascriptException exception)
            {
                if (JavascriptExecutor.IsInternalException(exception.Message))
                {
                    // ignore internal exceptions, they will be handled by the EvaluateScript caller
                    return;
                }
                var javascriptException = new JavascriptException(
                    exception.Message,
                    exception.StackTrace.Select(l => {
                    var location = l.SourceName + ":" + l.LineNumber + ":" + l.ColumnNumber;
                    return(JavascriptException.AtSeparator + (string.IsNullOrEmpty(l.FunctionName) ? location : l.FunctionName + " (" + location + ")"));
                }).ToArray());

                OwnerWebView.ForwardUnhandledAsyncException(javascriptException);
            }
Example #2
0
            public void OnUncaughtException(IWebBrowser browserControl, IBrowser browser, IFrame frame, CefSharp.JavascriptException exception)
            {
                if (JavascriptExecutor.IsInternalException(exception.Message))
                {
                    // ignore internal exceptions, they will be handled by the EvaluateScript caller
                    return;
                }
                var javascriptException = new JavascriptException(exception.Message, exception.StackTrace);

                OwnerWebView.ForwardUnhandledAsyncException(javascriptException, frame.Name);
            }
        public void OnUncaughtException(IWebBrowser browserControl, IBrowser browser, IFrame frame, CefSharp.JavascriptException exception)
        {
            if (JavascriptExecutor.IsInternalException(exception.Message))
            {
                return;
            }
            JavascriptException e = new JavascriptException(exception.Message, exception.StackTrace);

            this.OwnerWebView.ForwardUnhandledAsyncException(e);
        }