// ==UserScript== // @name 知乎简洁摸鱼 // @namespace http://tampermonkey.net/ // @version 1.1 // @description 简化界面,摸鱼专用 // @author JB // @match https://www.zhihu.com/* // @match https://www.zhihu.com/question/* // @match https://www.zhihu.com/question/*/answer/* // @match https://www.zhihu.com/search* // @match https://www.zhihu.com/collection/* // @icon https://static.zhihu.com/heifetz/favicon.ico // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... var url = window.location.href; if(url=="https://www.zhihu.com/"){ zhuye(); }else if(url.search("https://www.zhihu.com/question") != -1 ){ question(); }else if(url.search("https://www.zhihu.com/search") != -1 ){ search(); }else if(url.search("https://www.zhihu.com/collection") != -1 ){ collection(); } function zhuye(){ //首页侧边栏 document.getElementsByClassName("GlobalSideBar GlobalSideBar--old")[0].style.display="none"; //去除顶部栏 document.getElementsByClassName("AppHeader-inner")[0].style.visibility="hidden"; //显示搜索框 document.getElementsByClassName("SearchBar-input")[0].style.visibility="visible"; //缩小标题字体 var titleList = document.getElementsByClassName('ContentItem-title'); for (var j = 0; j < titleList.length; j++) { titleList[j].style.fontSize = '16px'; titleList[j].style.fontWeight = '200'; } //缩小图片 var img=document.getElementsByTagName('img'); for (var l = 0; l