您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
专注阅读CSDN博客主要内容
- // ==UserScript==
- // @name CSDN博客
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description 专注阅读CSDN博客主要内容
- // @author You
- // @match *://blog.csdn.net/*/article/details/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var $container = $('div.container.clearfix');
- var $children;
- if ($container.length > 0) {
- var $parent = $container.parent();
- $children = $parent.children(':not(div.container.clearfix)');
- remove($children);
- $children = $container.children(':not(main)');
- remove($children);
- var $main = $container.children('main');
- $main.css('width', '100%');
- $children = $main.children(':not(article,div.readall_box)');
- remove($children);
- } else {
- var $target = $('#article_details');
- while ($target.length > 0) {
- if ($target[0].id === 'main') {
- $target.css('padding-left', '0');
- } else if ($target[0].tagName.toLowerCase() === 'body') {
- break;
- }
- var $siblings = $target.siblings();
- remove($siblings);
- $target = $target.parent();
- }
- }
- function remove(list) {
- for (var i = 0; i < list.length; ++i) {
- list[i].remove();
- }
- }
- })();