spanish-quizzer

An app to quiz you on Spanish vocabulary and verb conjugations
git clone https://git.ashermorgan.net/spanish-quizzer/
Log | Files | Refs | README

commit 9ed2c176d5db16cc292a833d6a50f5c9d1656227
parent f20349bf2f73e69ac61c550764b7b64210675598
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Fri, 23 Oct 2020 19:15:46 -0700

Fix bugs in browser validation.

Diffstat:
Mjs/home.js | 11+++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/js/home.js b/js/home.js @@ -66,20 +66,15 @@ function loadVue() { */ StartSession: function(prompts, promptIndex, settings) { // Validate browser for voice input - if (this.settings.inputType !== "Text") { - if (typeof InstallTrigger !== "undefined") { - // Browser is Firefox - alert("You must enable speech recognition in about:config."); - } - else if (!window.chrome || (!window.chrome.webstore && !window.chrome.runtime)) { - // Browser is not Googole Chrome or Microsoft (Chromium) Edge + if (settings.inputType !== "Text") { + if ((window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition) === undefined) { alert("Your browser does not support voice input."); return; } } // Give iOS devices ringer warning for prompt audio - if (this.settings.promptType !== "Text") { + if (settings.promptType !== "Text") { if (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) { alert("Please make sure your ringer is on in order to hear audio prompts."); }