// ==UserScript== // @name 手机网页版IT之家去除广告和干扰 // @namespace https://greasyfork.org/zh-CN/users/442617-punkjet // @version 0.7 // @description 手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。 // @author PunkJet // @match *://m.ithome.com/* // @grant none // @require http://code.jquery.com/jquery-3.x-git.min.js // @downloadURL none // ==/UserScript== (function() { 'use strict'; $(document).ready(function(){ $(".open-app-banner").remove(); $(".open-app").remove(); $("div[class='news-class']").remove(); $(".main-site").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(); } 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() { if($(this).text().match("福包") || $(this).text().match("大促") || $(this).text().match("开售") || $(this).text().match("预约") || $(this).text().match("限免") || $(this).text().match("精选") || $(this).text().match("限时")|| $(this).text().match("节")|| $(this).text().match("抢")) { $(this).closest("div.placeholder").remove(); } }); }