您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
简化百度首页,只保留搜索框
// ==UserScript== // @name 百度首页简化器 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 简化百度首页,只保留搜索框 // @author Your name // @match *://www.baidu.com/ // @match *://baidu.com/ // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; // 创建样式 const style = document.createElement('style'); style.textContent = ` /* 隐藏不需要的元素 */ #s-top-left, #u1, #s_side_wrapper, #bottom_layer, #s_wrap, .s-bottom-layer-content, #bottom_container, .s-hotsearch-wrapper, .s-news-wrapper { display: none !important; } /* 调整logo位置 */ #lg { margin-top: 100px !important; } /* 调整搜索框位置 */ #form { margin-top: 30px !important; } /* 保持页面干净 */ .wrapper_new #head { border-bottom: none !important; } /* 移除背景 */ #head { background: none !important; } `; // 添加样式到页面 document.head.appendChild(style); // 移除多余的DOM元素 function removeElements() { const elementsToRemove = [ 'bottom_layer', 's_side_wrapper', 's-bottom-layer-content', 'bottom_container' ]; elementsToRemove.forEach(id => { const element = document.getElementById(id); if (element) { element.remove(); } }); } // 页面加载完成后执行 window.addEventListener('load', removeElements); // 也在DOM加载完成后执行一次,以确保元素被移除 document.addEventListener('DOMContentLoaded', removeElements); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址