Greasy Fork

Greasy Fork is available in English.

手机网页版IT之家去除广告和干扰

手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。

目前为 2020-02-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         手机网页版IT之家去除广告和干扰
// @namespace    http://greasyfork.icu/zh-CN/users/442617-punkjet
// @version      0.2
// @description  手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。
// @author       PunkJet
// @match        *://m.ithome.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    $(".open-app-banner").remove();
    $(".open-app").remove();
    removeIthomeAds();

    window.addEventListener("scroll", function() {
        removeIthomeAds();
        removeIthomeArticleAds();
    })
})();

function removeIthomeArticleAds() {
    $(".down-app-box").remove();
    $("div[class='relevant-news']").remove();
    $("div[class='hot-app']").remove();
    $("div[class='ggp-promotion']").remove();
    $("div[class='grade']").remove();
    $("div[id='bd-share-box']").remove();
    $("div[class='lapin']").remove();
    $("div[class='news-class']").remove();
}

function removeIthomeAds() {
    var spans1 = $("span[class='tip-suggest']");
    spans1.each(function() {
        $(this).closest("div.placeholder").remove();
    });

    var spans2 = $("span[class='tip tip-gray']");
    spans2.each(function() {
        $(this).closest("div.placeholder").remove();
    });
}