Greasy Fork

Greasy Fork is available in English.

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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         手机网页版IT之家去除广告和干扰
// @namespace    http://greasyfork.icu/zh-CN/users/442617-punkjet
// @version      2025.10.13
// @description  手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。
// @author       PunkJet
// @run-at       document-end
// @match        *://m.ithome.com/*
// @grant        none
// ==/UserScript==
 
function removeHongbao(){
    const allIframes = document.querySelectorAll('iframe');
    allIframes.forEach(iframe=> {iframe.remove();});
}

(function() {
    'use strict';
 
    $(".open-app-banner").remove();
    $("modal has-title loaded").remove();
    $(".open-app").remove();
    $(".brand-column-lapin").remove();
    $(".main-site").remove();//去除文章内容中的购物链接
    $(".news-class").remove();
    setTimeout(removeHongbao, 250);
    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();
}
 
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();
    });
 
    var spans3 = $("span[class='tip tip-green']");
    spans3.each(function() {
        $(this).closest("div.placeholder").remove();
    });
 
    var p1 = $("p[class='plc-title']");//删除标题关键字
    p1.each(function() {
    let deleteStr=["领券","红包","福包","元","福包","大促","开售","预约","限免","精选","限时","节","抢","折","补贴","省钱","618","11"];

    for (let index in deleteStr){
        if($(this).text().match(deleteStr[index])){
        $(this).closest("div.placeholder").remove();
       }
    }
        
    });
 
 
}