您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
知乎排版优化!
当前为
// ==UserScript== // @name 知乎排版优化 // @namespace https://www.zhihu.com/ // @version 0.2 // @description 知乎排版优化! // @author You // @match https://www.zhihu.com/question* // @match https://www.zhihu.com // @grant none // ==/UserScript== (function() { 'use strict'; function getByClass(sClass){ var aResult=[]; var aEle=document.getElementsByTagName('*'); /*正则模式*/ var re=new RegExp("\\b" + sClass + "\\b","g"); for(var i=0;i<aEle.length;i++){ /*字符串search方法判断是否存在匹配*/ if(aEle[i].className.search(re) != -1){ aResult.push(aEle[i]); } } return aResult[0]; } var selectInner = getByClass('zm-side-section-inner').getElementsByTagName("button"); var re = getByClass('zu-main-sidebar'); re.remove(); var inner = getByClass('zu-main-content-inner'); inner.style.marginLeft = '150px'; inner.style.marginRight = '150px'; var backtotop = getByClass('zh-backtotop'); backtotop.style.marginLeft = '350px'; var rightInner = document.createElement("div"); rightInner.className='zu-main-sidebar'; rightInner.style.width = '0'; rightInner.style.marginLeft = '-130px'; rightInner.appendChild(selectInner[0]); var zuMain = document.getElementById('zh-single-question-page'); zuMain.appendChild(rightInner); })();