您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides the header section of a specific GitHub page.
// ==UserScript== // @name 隐藏github blob页面的header // @namespace http://tampermonkey.net/ // @version 1.0.1 // @description Hides the header section of a specific GitHub page. // @match https://github.com/*/blob/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 创建样式元素 const style = document.createElement('style'); style.textContent = ` .AppHeader { display: none !important; } `; document.head.appendChild(style); // 监听 DOM 变化,处理动态加载的元素 const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { const appHeaders = document.getElementsByClassName('AppHeader'); for (let header of appHeaders) { header.style.display = 'none'; } }); }); // 配置观察选项 const config = { childList: true, subtree: true }; // 开始观察文档变化 observer.observe(document.body, config); })();