只需一行代码,网页即支持段落阅读
document.onselectionchange=function(){speechSynthesis.cancel();speechSynthesis.speak(new SpeechSynthesisUtterance(document.getSelection().baseNode.data))}
打开浏览器(Edge/Chrome均可),F12,点击控制台,粘贴上面代码,回车
只需一行代码,网页即支持段落阅读
document.onselectionchange=function(){speechSynthesis.cancel();speechSynthesis.speak(new SpeechSynthesisUtterance(document.getSelection().baseNode.data))}
打开浏览器(Edge/Chrome均可),F12,点击控制台,粘贴上面代码,回车