Closed owl-from-hogvarts closed 5 months ago
I propose a solution: check if text-to-speech is supported by browser and only then show try to work with it
Opera not supported officially btw, lol. Free to open PR's for in separated branches / do own forks for Opera.
This issue I believe is coming after this update: https://github.com/ixrock/XTranslate/commit/b121a83334874a15a452275b31caa7cec61942a2
@owl-from-hogvarts I recommend to you also switch from opera to Brave / Chrome / Vivaldi. BTW I've been used opera since 6(or even 7) when it wasn't on chrome engine and stopped at some point, now it's more funny joke then a browser.
What's wrong
Extension crashes when text is deselected. Issue comes from
hidePopup
method which unconditionally callsstopSpeaking
. This in turn tries to accessspeechSynthesis
object which is non-existent in Opera browser.Stack Trace
![Stack trace](https://github.com/ixrock/XTranslate/assets/47751812/14dd132e-1664-40cf-9084-9d23afc5ad12) ``` Uncaught ReferenceError: speechSynthesis is not defined at stopSpeaking (user-script.js:27030:5) at Google.stopSpeaking (user-script.js:27216:9) at App.hidePopup (user-script.js:31701:63) at App.onMouseDown (user-script.js:31832:22) ```Expected behavior
When text is deselected popup should hide without producing any errors
How to reproduce
System information
XTranslate version:
3.3.2
Opera version:110.0.5130.23
System:Arch Linux
I can provided more information on demand. I can't figure out right now what else can be useful.