Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
MobileAccessibility.prototype.activateOrDeactivateChromeVox = function(bool) {
if (device.platform !== "Android") return;
if (typeof cvox === "undefined") {
if (bool) {
console.warn('A screen reader is running but ChromeVox has failed to initialize.');
if (navigator.connection.type === Connection.UNKNOWN || navigator.connection.type === Connection.NONE) {
mobileAccessibility.injectLocalAndroidVoxScript();
}
}
} else {
// activate or deactivate ChromeVox based on whether or not or not the screen reader is running.
try {
cvox.ChromeVox.host.activateOrDeactivateChromeVox(bool);
} catch (err) {
console.error(err);
}
}
MobileAccessibility.prototype.isTalkBackRunning = function(callback) {
if (device.platform.toLowerCase() === "android" || device.platform.toLowerCase() === "amazon-fireos") {
MobileAccessibility.prototype.isScreenReaderRunning(callback);
} else {
callback(false);
}
};
MobileAccessibility.prototype.isChromeVoxActive = function () {
MobileAccessibility.prototype.isVoiceOverRunning = function(callback) {
if (device.platform.toLowerCase() === "ios") {
MobileAccessibility.prototype.isScreenReaderRunning(callback);
} else {
callback(false);
}
};
MobileAccessibility.prototype.isTalkBackRunning = function(callback) {