// ==UserScript== // @name 拷贝漫画PC显示评论 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 改自Byaidu的拷贝漫画增强插件,只保留评论的加载和发送功能,并重做了ui // @author ljw2487 // @match *://*.copymanga.com/* // @match *://*.copymanga.org/* // @match *://*.copymanga.net/* // @match *://*.copymanga.info/* // @match *://*.copymanga.site/* // @match *://*.copymanga.tv/* // @match *://copymanga.com/* // @match *://copymanga.org/* // @match *://copymanga.net/* // @match *://copymanga.info/* // @match *://copymanga.site/* // @match *://copymanga.tv/* // @license GNU General Public License v3.0 or later // @resource element_css https://unpkg.com/element-ui@2.15.0/lib/theme-chalk/index.css // @resource animate_css https://unpkg.com/animate.css@4.1.1/animate.min.css // @require https://unpkg.com/vue@2.6.12/dist/vue.min.js // @require https://unpkg.com/element-ui@2.15.0/lib/index.js // @require https://unpkg.com/axios@0.27.2/dist/axios.min.js // @require https://unpkg.com/store.js@1.0.4/store.js // @require https://unpkg.com/jquery@3.5.1/dist/jquery.min.js // @require https://unpkg.com/jszip@3.1.5/dist/jszip.min.js // @require https://unpkg.com/file-saver@2.0.5/dist/FileSaver.min.js // @require https://unpkg.com/crypto-js@4.1.1/crypto-js.js // @grant GM_addStyle // @grant GM_getResourceText // @grant GM_xmlhttpRequest // @run-at document-start // @downloadURL none // ==/UserScript== // retry 拦截器 axios.interceptors.response.use(undefined, (err) => { return new Promise((resolve)=>{setTimeout(()=>{resolve()},1000)}).then(() => axios(err.config)); }); function route() { console.log('LOAD SUCCESSED', window.document.title) // /comic/gengjuesezhuanshengtaiguotoule/chapter/bf86c68c-195a-11ec-943d-00163e0ca5bd if (/^\/comic\/.*\/.*$/.test(location.pathname)) comicPage(1) else if (/^\/h5\/comicContent\/.*\/.*$/.test(location.pathname)) comicPage(0) } route() /////////////////////////////////////////////////////////////////////// async function loadCSS(){ var element_css, animate_css; if (typeof(GM_getResourceText)=='undefined'){ await axios.get('https://unpkg.com/element-ui@2.15.0/lib/theme-chalk/index.css') .then(function (response) { element_css = response.data; }) await axios.get('https://unpkg.com/animate.css@4.1.1/animate.min.css') .then(function (response) { animate_css = response.data; }) }else{ element_css = GM_getResourceText("element_css"); animate_css = GM_getResourceText("animate_css"); } GM_addStyle(element_css); GM_addStyle(animate_css); } ///////////////////////////////////////////////////////////////////// async function comicPage(isPC) { loadCSS() var comic, chapter, htmlBody, newDiv, newStyle if (isPC) comic = window.location.pathname.split('/')[2] else comic = window.location.pathname.split('/')[3] chapter = window.location.pathname.split('/')[4] // console.log('Comic:', comic,'|| Chapter:', chapter) // htmlBody = document.getElementsByTagName('body')[0] console.log(htmlBody) newDiv = document.createElement('div') newDiv.innerHTML = `