SEBWIN-607, #480, #499: Fixed access to potentially uninitialized DOM in accessibility JavaScript code.
This commit is contained in:
parent
f948463685
commit
3bd786543d
2 changed files with 2 additions and 0 deletions
|
@ -512,6 +512,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
|
|||
var javascript = @"
|
||||
if (typeof __SEB_focusElement === 'undefined') {
|
||||
__SEB_focusElement = function (forward) {
|
||||
if (!document.body) { return; }
|
||||
var items = [].map
|
||||
.call(document.body.querySelectorAll(['input', 'select', 'a[href]', 'textarea', 'button', '[tabindex]']), function(el, i) { return { el, i } })
|
||||
.filter(function(e) { return e.el.tabIndex >= 0 && !e.el.disabled && e.el.offsetParent; })
|
||||
|
|
|
@ -508,6 +508,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
|
|||
var javascript = @"
|
||||
if (typeof __SEB_focusElement === 'undefined') {
|
||||
__SEB_focusElement = function (forward) {
|
||||
if (!document.body) { return; }
|
||||
var items = [].map
|
||||
.call(document.body.querySelectorAll(['input', 'select', 'a[href]', 'textarea', 'button', '[tabindex]']), function(el, i) { return { el, i } })
|
||||
.filter(function(e) { return e.el.tabIndex >= 0 && !e.el.disabled && e.el.offsetParent; })
|
||||
|
|
Loading…
Reference in a new issue