From 117ced0bf5d4e2449e7c6ce033d806432f86ee1c Mon Sep 17 00:00:00 2001 From: Jonas Sourlier Date: Tue, 3 May 2022 11:24:34 +0200 Subject: [PATCH] adapt accessibility changes to SEBWIN-531, #240 changes (7142380) --- .../Windows/BrowserWindow.xaml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs index b1fcea50..2d4f4126 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs @@ -37,6 +37,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows private readonly BrowserSettings settings; private readonly IText text; private readonly ILogger logger; + private readonly IBrowserControl browserControl; private WindowClosedEventHandler closed; private WindowClosingEventHandler closing; @@ -82,6 +83,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows this.settings = settings; this.text = text; this.logger = logger; + this.browserControl = browserControl; InitializeComponent(); InitializeBrowserWindow(browserControl); @@ -460,8 +462,7 @@ if (typeof __SEB_focusElement === 'undefined') { setTimeout(function () { item && item.focus && item.focus(); }, 20); } }"; - var control = BrowserControlHost.Child as IBrowserControl; - control.ExecuteJavascript(javascript, result => + this.browserControl.ExecuteJavascript(javascript, result => { if (!result.Success) { @@ -469,7 +470,7 @@ if (typeof __SEB_focusElement === 'undefined') { } }); - control.ExecuteJavascript("__SEB_focusElement(" + forward.ToString().ToLower() + ")", result => + this.browserControl.ExecuteJavascript("__SEB_focusElement(" + forward.ToString().ToLower() + ")", result => { if (!result.Success) {