protected virtual void OnJavascriptError(JavascriptErrorEventArgs e)
 {
     if (_JavascriptError != null)
     {
         _JavascriptError(this, e);
     }
 }
            public bool OnError(nsAUTF8StringBase message, nsAUTF8StringBase fileName, uint line, uint pos, uint flags, uint errnum, jsdIValue exc)
            {
                if (m_browser.IsDisposed)
                {
                    return(true);
                }
                var eventArgs = new JavascriptErrorEventArgs(message.ToString(), fileName.ToString(), line, pos, flags, errnum);

                m_browser.OnJavascriptError(eventArgs);
                return(true);
            }
Example #3
0
 private void OnJavascriptError(object sender, JavascriptErrorEventArgs e)
 {
     if(e.Message.Contains("sourceMapping"))
         return;
     var file = e.Filename.Split(new char[] { '/' }).Last();
     var line = (int) e.Line;
     var dir = FileLocator.GetDirectoryDistributedWithApplication(BloomFileLocator.BrowserRoot);
     var mapPath = Path.Combine(dir, file + ".map");
     if(RobustFile.Exists(mapPath))
     {
         var consumer = new SourceMapDotNet.SourceMapConsumer(RobustFile.ReadAllText(mapPath));
         foreach(var match in consumer.OriginalPositionsFor(line))
         {
             file = match.File;
             line = match.LineNumber;
             break;
         }
     }
     Debug.WriteLine("{0} in {1}:{2}", e.Message,file, line);
     NonFatalProblem.Report(ModalIf.None, PassiveIf.All, e.Message,
         string.Format("{0} in {1}:{2}", e.Message, file, line));
 }
		protected virtual void OnJavascriptError(JavascriptErrorEventArgs e)
		{
			if (_JavascriptError != null)
				_JavascriptError(this, e);
		}
			public bool OnError(nsAUTF8StringBase message, nsAUTF8StringBase fileName, uint line, uint pos, uint flags, uint errnum, jsdIValue exc)
			{
				if (m_browser.IsDisposed) return true;
				var eventArgs = new JavascriptErrorEventArgs(message.ToString(), fileName.ToString(), line, pos, flags, errnum);
				m_browser.OnJavascriptError(eventArgs);
				return true;
			}
 private void _browser_JavascriptError(object sender, JavascriptErrorEventArgs e)
 {
     Console.WriteLine("{0}, {1}:{2}", e.Message, e.Filename, e.Line);
 }