realpython

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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();
    }

})();