您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
清除首页滚动条
// ==UserScript== // @name 移除百度首页滚动条 // @license MIT // @namespace [email protected] // @version 1.0 // @description 清除首页滚动条 // @author Marcus Xu // @match *://www.baidu.com/ // @match *://www.baidu.com/?tn=* // @icon https://www.google.com/s2/favicons?sz=64&domain=baidu.com // @grant window.onurlchange // ==/UserScript== (function () { 'use strict'; let scrollbarRemoved = false // 是否是首页 if (location.pathname === '/') { // 去除首页滚动条 document.getElementsByTagName('html')[0].style = "overflow:hidden"; scrollbarRemoved = true } window.onurlchange = function () { if (location.pathname !== '/' && scrollbarRemoved) { document.getElementsByTagName('html')[0].style = ""; scrollbarRemoved = false } } })();