您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
删除class为page-sidebar的元素,并将id为readmore-container的元素高度设置为默认
// ==UserScript== // @name 调整阅读更多容器 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 删除class为page-sidebar的元素,并将id为readmore-container的元素高度设置为默认 // @match https://programmercarl.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 创建一个新的样式元素 const style = document.createElement('style'); style.textContent = ` .content__default { height: auto !important; } `; document.head.appendChild(style); // 删除class为page-sidebar的元素 const sidebars = document.querySelectorAll('.page-sidebar'); for (const sidebar of sidebars) { sidebar.parentNode.removeChild(sidebar); } // 将id为readmore-container的元素高度设置为默认 const readmoreContainer = document.getElementById('readmore-container'); if (readmoreContainer) { readmoreContainer.classList.add('auto-height'); } })();