// ==UserScript== // @name 笔趣阁 biqukan 小说朗读 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 笔趣阁 朗读 // @author sungf // @compatible html5 // @include https://www.biqukan.com/*/* // @downloadURL none // ==/UserScript== (function() { const speechSynthesis = message => { const msg = new SpeechSynthesisUtterance(message); msg.voice = window.speechSynthesis.getVoices()[0]; msg.onend = ()=> window.speechSynthesis.pending || document.getElementsByClassName('page_chapter')[0].children[0].children[2].children[0].click(); window.speechSynthesis.speak(msg); }; let stra = document.getElementById("content").innerText.split('\n'); let regex = /\(https:\/\/www.biqukan.com\/*/ for (let i = 0; i < stra.length; i++){ let s = stra[i]; if (regex.test(s.trim())) { break } speechSynthesis(s); } })();