Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
announceScreenReader: function ar_announceScreenReader() {
var enabled = this.settings['accessibility.screenreader'];
this.isSpeaking = true;
return this.speak({
string: enabled ? 'disableScreenReaderSteps' : 'enableScreenReaderSteps'
}, {enqueue: false});
},
this.reset();
if (!this.isSpeaking && timeStamp > this.expectedCompleteTimeStamp) {
this.cancelSpeech();
this.announceScreenReader(function onEnd() {
this.resetSpeaking(timeStamp + this.REPEAT_BUTTON_PRESS);
}.bind(this));
return;
}
this.cancelSpeech();
this.resetSpeaking();
SettingsListener.getSettingsLock().set({
'accessibility.screenreader':
!this.settings['accessibility.screenreader']
});
},
req.onsuccess = function bt_getSettingsSuccess() {
gScreenreaderCheckbox.checked = req.result['accessibility.screenreader'];
};
announceScreenReader: function ar_announceScreenReader(aCallback) {
var enabled = this.settings['accessibility.screenreader'];
this.isSpeaking = true;
this.speak({
string: enabled ? 'disableScreenReaderSteps' : 'enableScreenReaderSteps'
}, aCallback, {enqueue: false});
},
this.reset();
if (!this.isSpeaking && timeStamp > this.expectedCompleteTimeStamp) {
this.speechSynthesizer.cancel();
this.announceScreenReader().then(() => {
this.resetSpeaking(timeStamp + this.REPEAT_BUTTON_PRESS);
});
return;
}
this.speechSynthesizer.cancel();
this.resetSpeaking();
SettingsListener.getSettingsLock().set({
'accessibility.screenreader':
!this.settings['accessibility.screenreader']
});
},
req.onsuccess = function bt_getSettingsSuccess() {
confirmDlg.show(!req.result['accessibility.screenreader']);
};