Пример #1
0
        private void OnJavascriptUncaughException(object sender, JavascriptUncaughtExceptionEventArgs e)
        {
            if (JavascriptExecutor.IsInternalException(e.Message))
            {
                // ignore internal exceptions, they will be handled by the EvaluateScript caller
                return;
            }
            var javascriptException = new JavascriptException(e.Message, e.StackFrames);

            ForwardUnhandledAsyncException(javascriptException, e.Frame.Name);
        }
Пример #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))
                {
                    // 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);
            }