Skip to content

Commit

Permalink
refactor(api/internal/monkeypatch.js): provide 'SpeechRecognition' fr…
Browse files Browse the repository at this point in the history
…om 'webkitSpeechRecognition'
  • Loading branch information
jwerle committed Sep 27, 2023
1 parent adca35f commit 7f236cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/internal/monkeypatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ let applied = false
export function init () {
if (applied || !globalThis.window) return

if (
typeof globalThis.webkitSpeechRecognition === 'function' &&
typeof globalThis.SpeechRecognition !== 'function'
) {
globalThis.SpeechRecognition = globalThis.webkitSpeechRecognition
}

Object.assign(globalThis, {
// url
URL,
Expand Down

0 comments on commit 7f236cc

Please sign in to comment.