qidian 朗读
// ==UserScript==
// @name qidan 小说朗读
// @namespace http://tampermonkey.net/
// @version 0.3
// @description qidian 朗读
// @author sungf
// @compatible html5
// @include https://vipreader.qidian.com/chapter/*
// @include https://read.qidian.com/chapter/*
// @include https://reader.qidian.com/chapter/*
// ==/UserScript==
(function() {
const speechSynthesis = message => {
const msg = new SpeechSynthesisUtterance(message);
msg.voice = window.speechSynthesis.getVoices()[0];
msg.onend = ()=> window.speechSynthesis.pending || document.getElementById('j_chapterNext').click();
window.speechSynthesis.speak(msg);
};
for(let i=0;i<document.getElementsByClassName("read-content")[0].children.length;i++){
speechSynthesis(document.getElementsByClassName("read-content")[0].children[i].innerText);
}
})();