您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
去除张鑫旭博客上面各种广告, 并且将正文宽度调整到最适合观看的角度, 让你全身心的投入到阅读学习当中
当前为
// ==UserScript== // @name 张鑫旭博客 特别清爽版 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 去除张鑫旭博客上面各种广告, 并且将正文宽度调整到最适合观看的角度, 让你全身心的投入到阅读学习当中 // @author zhenhappy // @match https://www.zhangxinxu.com/** // ==/UserScript== const $ = document.querySelector.bind(document); const $$ = document.querySelectorAll.bind(document); (function() { 'use strict'; const removeList = [ '#sidebar', '.da_title', '.da_col2', '.link', '.ins_txt', '#daITxz2', '.hd_remind', '.description' ] removeList.forEach(remove); if (document.getElementById('content')) document.getElementById('content').style.marginLeft = "0"; if (document.getElementById('content')) document.getElementById('content').style.marginRight = "0"; if (document.getElementById('content')) document.getElementById('content').style.paddingLeft = "0"; if (document.getElementById('content')) document.getElementById('content').style.paddingRight = "0"; if (document.getElementById('respond')) document.getElementById('respond').style.paddingLeft = "0"; if (document.getElementById('respond')) document.getElementById('respond').style.paddingRight = "0"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.paddingLeft = "0"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.paddingRight = "0"; if (document.querySelector('#content > .post')) document.querySelector('#content > .post').style.marginLeft = "auto"; if (document.querySelector('#content > .post')) document.querySelector('#content > .post').style.marginRight = "auto"; if (document.getElementById('respond')) document.getElementById('respond').style.marginLeft = "auto"; if (document.getElementById('respond')) document.getElementById('respond').style.marginRight = "auto"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.marginLeft = "auto"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.marginRight = "auto"; if (document.querySelector('#content > .post')) document.querySelector('#content > .post').style.width = "1440px"; if (document.querySelector('#content > .post')) document.querySelector('#content > .post').style.maxWidth = "90%"; if (document.getElementById('respond')) document.getElementById('respond').style.width = "1440px"; if (document.getElementById('respond')) document.getElementById('respond').style.maxWidth = "90%"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.width = "1440px"; if (document.querySelector('.commentlist')) document.querySelector('.commentlist').style.maxWidth = "90%"; })(); function remove(el) { if (typeof el === "string") remove([...$$(el)]); else if (el instanceof HTMLElement) el.parentNode.removeChild(el); else if (el instanceof NodeList) remove([...el]); else if (el instanceof Array) el.forEach(remove); }