Greasy Fork

Greasy Fork is available in English.

it之家手机版去除广告

it之家手机版去除列表中的广告

当前为 2018-10-31 提交的版本,查看 最新版本

// ==UserScript==
// @name         it之家手机版去除广告
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  it之家手机版去除列表中的广告
// @author       aNightCat
// @match        *://m.ithome.com
// @grant        none

// ==/UserScript==

(function() {
    'use strict';

    checkJquery();
    removeAds();
    $(".open-app-banner").remove();
    $(".open-app").remove();
})();

$(document).scroll(function(){
    removeAds();
})

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

function checkJquery() {
    if (!typeof jQuery) {
        var jqueryScript = document.createElement("script");
        jqueryScript.type = "text/javascript";
        jqueryScript.src = "https://code.jquery.com/jquery-3.3.1.min.js";
        document.head.append(jqueryScript);
    }
}