realpython

清理realpython多余元素,便于阅读

目前為 2019-01-28 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

Advertisement:

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

Advertisement:

// ==UserScript==
// @name         realpython
// @namespace    http://www.jiangyixin.top/
// @version      0.1
// @description  清理realpython多余元素,便于阅读
// @author       jiangyixin
// @match        *://realpython.com/*
// @resource     https://code.jquery.com/jquery-3.3.1.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = function() {
        function set_timer(name, clas) {
        	window[name] = window.setInterval(function () {
        		if ($(clas).length == 1) {
        			$(clas).remove();
        			window.clearInterval(window[name]);
        		}
        	}, 1000);
        }
        set_timer('share', '#at4-share');
    	var ts = $('.sidebar-module.sidebar-module-inset.border');
    	if (ts.length > 1) {
    		$(ts[0]).remove();
    	}
    	$('.navbar.sticky-top.navbar-expand-lg.navbar-dark.flex-column').remove();
    	$('.sidebar-module.sidebar-module-inset.p-0').remove();
    	$('.drip-tab-container').remove();
        $('.card.mb-3.bg-secondary').remove();
        $('.col-12.rounded.p-0.w-100.mt-2.mb-4').remove();
        $('.mx-3.py-5.mb-5.mt-0.alert.alert-light.border.text-dark').remove();
        $('.sidebar-module.sidebar-module-inset.p-0.my-4').remove();
        $('.card.mt-4').remove();
        $('.footer').remove();
    }

})();