// ==UserScript== // @name 自动展开CSDN博客、CSDN下载页、道客88、百度文库、百度知道、回形针、人民日报客户端页面的隐藏内容 // @namespace http://tampermonkey.net/ // @version 0.0.6 // @description 自动展开一些PC网站的隐藏内容;个人觉得手机端不需要做,故只在PC端有用;为了更好的上网体验,不兼容低版本浏览器和IE浏览器。大家如有发现类似需要手动点开隐藏内容的网站,请至以下网址反馈吧https://greasyfork.org/zh-CN/forum/discussion/72571/x // @author You // @match *blog.csdn.net/* // @match *download.csdn.net/download/*/* // @match *www.doc88.com/* // @match *wenku.baidu.com/view/* // @match *zhidao.baidu.com/question* // @match *www.ipaperclip.net/doku.php?id=* // @match *wap.peopleapp.com/article/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; function showFull(btn){ const $btn = document.querySelectorAll(btn)[0]; $btn.click(); }; const btns = Array( '.btn-readmore', '#continueButton', '.show-hide-btn', '.down-arrow', '.paperclip__showbtn', '.expend', '.shadow-2n5oidXt' ), asyncBtns = Array( '.wgt-answers-showbtn', '.wgt-best-showbtn', '.read-more-zhankai' ), len = btns.length; for (let i = 0; i < len; i++) { const d = btns[i], dom = document.querySelectorAll(d); if(dom[0]){ if (d === '.paperclip__showbtn') { Array.from(dom).map((item)=>{ item.click(); }) }else{ showFull(d); break; } } } function setAsyncAddDom (){ for (let i = 0; i < asyncBtns.length; i++) { const d = asyncBtns[i], dom = document.querySelectorAll(d); if(dom[0]){ dom[0].click() } } } setTimeout(setAsyncAddDom, 2000) })();