Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Why does a SpeechSynthesisUtterance sometimes not fire an 'end' event in Chromium-based browsers?
const button = document.createElement('button');
const arr = [];
button.innerHTML = 'click';
button.onclick = () => {
console.log('start script');
// button.disabled = true;
const utt = new SpeechSynthesisUtterance('e');
utt.addEventListener('end', () => {
arr.push('end event triggered at ' + new Date().getTime());
console.log(arr[arr.length-1], arr.length);
// just for debugging completeness, no errors seem to be thrown though
utt.addEventListener('error', (err) => {
console.log('err', err)
setTimeout(() => {
}, 1500);

This comment has been minimized.

Copy link
Owner Author

guest271314 commented Mar 8, 2019

@Kaiido Cannot reproduce at 72.0.3626.121. Is the issue console printing the same message on the same line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.