Greasy Fork

起点中文网去除推荐;百度去除搜索热点列表;B站去除推荐、评论;网易云去除推荐、评论

这个脚本的功能有:起点中文网去除推荐;百度去除搜索热点列表;B站去除推荐、评论;网易云去除推荐、评论

目前为 2022-01-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         起点中文网去除推荐;百度去除搜索热点列表;B站去除推荐、评论;网易云去除推荐、评论
// @namespace    https://greasyfork.org/
// @version      0.4.0
// @description  这个脚本的功能有:起点中文网去除推荐;百度去除搜索热点列表;B站去除推荐、评论;网易云去除推荐、评论
// @author       sanjie27
// @match        https://book.qidian.com/*/*
// @match        https://www.qidian.com/
// @match        https://www.baidu.com/*
// @match        https://music.163.com/*
// @match        https://www.bilibili.com/*
// @run-at       document_start
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // 创建函数
    let change_element = function (element, status) {
        if (document.getElementsByClassName(element)) {
            [...document.getElementsByClassName(element)].map(n => n.style.visibility = status);
        }
        if (document.getElementById(element)) {
            document.getElementById(element).style.visibility = status;
        }
    };

    // 要隐藏的元素的class或id
    let elements = ["m-rctlist f-cb", "g-wrap7", "m-sglist f-cb", "right-wrap fr",
                    "nav-list site-nav fl", "like-more-list", "book-list-wrap mb10", "recommend-book", //起点
                    "s-news-wrapper clearfix", "opr-recommends-merge-content", "cr-content",
                    "rs", "hotsearch-content-wrapper", "rs_new",//百度
                    "recommend-list report-wrap-module report-scroll-module", "pop-live report-wrap-module report-scroll-module",
                    "list-item reply-wrap is-top", "comment", "reco_list", "live_recommand_report",
                    "cmmts j-flag", "g-sd4",//网易云
                   ];


    document.addEventListener('DOMContentLoaded', function () {
        elements.forEach(function (i) {
            change_element(i, "hidden");
        });
    });

})();