Greasy Fork

Greasy Fork is available in English.

去除网页中讨厌元素的小工具

通过css去掉网页中那些令人讨厌的东西,比如腾讯课堂的正在观看弹幕,简书的推荐故事等

// ==UserScript==
// @name         去除网页中讨厌元素的小工具
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  通过css去掉网页中那些令人讨厌的东西,比如腾讯课堂的正在观看弹幕,简书的推荐故事等
// @author       星河
// @match        https://www.jianshu.com/*
// @match        https://ke.qq.com/*
// @match        https://www.gushiwen.cn/*
// @match        https://so.gushiwen.cn/* 
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    setTimeout(() => {

        const url = window.location.href;

        if (url.includes('jianshu')) { //简书去除右侧推荐故事
            const arr = document.querySelectorAll('._3Z3nHf');
            arr[1].style.cssText = 'display: none';
        }else if (url.includes('ke.qq')) { //腾讯课堂去除正在观看弹幕
            const style = document.createElement('style');
            style.appendChild(document.createTextNode('#video-container div { transform: scale(0, 0) }'));
            document.querySelector('#video-container').appendChild(style);
        }else if (url.includes('gushiwen')){ //去除古诗文网的二维码弹窗
            const style = document.createElement('style');
            style.appendChild(document.createTextNode('#threeWeixin2 { transform: scale(0, 0) }'));
            document.querySelector('.main3').appendChild(style);
        }

    }, 3000);

})();