• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yext / answers-search-ui / 25056746509

28 Apr 2026 01:48PM UTC coverage: 61.829% (+0.003%) from 61.826%
25056746509

push

github

web-flow
chore: support unprefixed SpeechRecognition API (#1988)

When the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API#javascript) was originally implemented, the speech recognition property was prefixed with webkit because it was an experimental webkit feature (window.webkitSpeechRecognition). As the feature has become more widely supported, some browsers have adopted an unprefixed version of the property (window.SpeechRecognition). This change updates our code to support both.

J=WAT-5460
TEST=auto

2045 of 3453 branches covered (59.22%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

3498 of 5512 relevant lines covered (63.46%)

26.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.48
/src/core/speechrecognition/support.js
1
import Bowser from 'bowser';
2

3
/**
4
 * Whether the SpeechRecognition API is supported by the current browser.
5
 *
6
 * Currently all languages in the SDK (en, es, fr, de, it, ja)
7
 * have SpeechRecognition support in browsers that support SpeechRecognition.
8
 * However, because browser specific SpeechRecognition documentation is poor to nonexistent,
9
 * new languages/locales will need to be manually tested for SpeechRecognition support.
10
 *
11
 * @returns {boolean}
12
 */
13
export function speechRecognitionIsSupported () {
14
  const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
2!
15
  if (!(SpeechRecognition && navigator.mediaDevices)) {
2!
UNCOV
16
    return false;
×
17
  }
18

19
  const browserData = Bowser.parse(navigator.userAgent);
2✔
20
  if (browserData.platform.type === 'desktop') {
2!
21
    return true;
2✔
22
  }
23

24
  const os = browserData.os.name;
×
25
  const browser = browserData.browser.name;
×
26

27
  return (browser === 'Safari' && os === 'iOS') ||
×
28
    (browser === 'Chrome' && os === 'Android') ||
29
    (browser === 'Samsung Internet for Android' && os === 'Android');
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc