From ef63a67aee9766f4eaa4939ab16306fe00bf8453 Mon Sep 17 00:00:00 2001 From: Jonas Sourlier Date: Tue, 3 May 2022 08:40:59 +0200 Subject: [PATCH] add logger for javascript errors --- .../Windows/BrowserWindow.xaml.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs index 0e8e6712..b1fcea50 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs @@ -36,6 +36,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows private readonly bool isMainWindow; private readonly BrowserSettings settings; private readonly IText text; + private readonly ILogger logger; private WindowClosedEventHandler closed; private WindowClosingEventHandler closing; @@ -75,11 +76,12 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows remove { closing -= value; } } - internal BrowserWindow(IBrowserControl browserControl, BrowserSettings settings, bool isMainWindow, IText text) + internal BrowserWindow(IBrowserControl browserControl, BrowserSettings settings, bool isMainWindow, IText text, ILogger logger) { this.isMainWindow = isMainWindow; this.settings = settings; this.text = text; + this.logger = logger; InitializeComponent(); InitializeBrowserWindow(browserControl); @@ -463,6 +465,7 @@ if (typeof __SEB_focusElement === 'undefined') { { if (!result.Success) { + logger.Error($"Javascript error {result.Message}!"); } }); @@ -470,6 +473,7 @@ if (typeof __SEB_focusElement === 'undefined') { { if (!result.Success) { + logger.Error($"Javascript error {result.Message}!"); } }); }