adapt accessibility changes to SEBWIN-531, #240 changes (7142380)

This commit is contained in:
Jonas Sourlier 2022-05-03 11:24:34 +02:00
parent 91b15eeb98
commit 117ced0bf5

View file

@ -37,6 +37,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
private readonly BrowserSettings settings; private readonly BrowserSettings settings;
private readonly IText text; private readonly IText text;
private readonly ILogger logger; private readonly ILogger logger;
private readonly IBrowserControl browserControl;
private WindowClosedEventHandler closed; private WindowClosedEventHandler closed;
private WindowClosingEventHandler closing; private WindowClosingEventHandler closing;
@ -82,6 +83,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
this.settings = settings; this.settings = settings;
this.text = text; this.text = text;
this.logger = logger; this.logger = logger;
this.browserControl = browserControl;
InitializeComponent(); InitializeComponent();
InitializeBrowserWindow(browserControl); InitializeBrowserWindow(browserControl);
@ -460,8 +462,7 @@ if (typeof __SEB_focusElement === 'undefined') {
setTimeout(function () { item && item.focus && item.focus(); }, 20); setTimeout(function () { item && item.focus && item.focus(); }, 20);
} }
}"; }";
var control = BrowserControlHost.Child as IBrowserControl; this.browserControl.ExecuteJavascript(javascript, result =>
control.ExecuteJavascript(javascript, result =>
{ {
if (!result.Success) 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) if (!result.Success)
{ {