Text to speech on selected text

If anyone is interested I have created a voice system for reading the selected text
the new file webviewer-ui.js

Speech = function() {
var e;
if (document.querySelector("#copy-textarea").value = “”, null === (e = window.getSelection()) || void 0 === e || !e.toString())
if (window.clipboardData) window.clipboardData.setData(“Text”, St.getSelectedText());
else {
var t = document.getElementById(“copy-textarea”);
aaa t.value = St.getSelectedText(), t.select(), t.setSelectionRange(0, 99999);
var msg = new SpeechSynthesisUtterance(t.value);
window.speechSynthesis.speak(msg);
}
}

this is a part of the code that I modified in the file

1 Like