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 5f3bfda82ab5b9b7a856c3960bce7bf6b2c77a18
parent 7148ac4a1406cd31b47a54272eb89f01122dcc68
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Wed,  1 Jul 2020 08:17:36 -0700

Update browser validation for voice input.

Diffstat:
MScripts/Quizzer.js | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Scripts/Quizzer.js b/Scripts/Quizzer.js @@ -34,7 +34,11 @@ function Start() { // Validate browser for voice input if (document.getElementById("settingsInputType").value != "Text") { - if (!window.chrome || (!window.chrome.webstore && !window.chrome.runtime)) { + 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 alert("Your browser does not support voice input."); return; @@ -81,7 +85,11 @@ function Resume() { // Validate browser for voice input if (document.getElementById("settingsInputType").value != "Text") { - if (!window.chrome || (!window.chrome.webstore && !window.chrome.runtime)) { + 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 alert("Your browser does not support voice input."); return;