Greasy Fork is available in English.
手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。
当前为
// ==UserScript==
// @name 手机网页版IT之家去除广告和干扰
// @namespace http://greasyfork.icu/zh-CN/users/442617-punkjet
// @version 0.7.5
// @description 手机网页版IT之家去除广告,文章页去除分享、评分相关文章等。
// @author PunkJet
// @run-at document-end
// @match *://m.ithome.com/*
// @grant none
// ==/UserScript==
(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();
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=["领券","福包","元","福包","大促","开售","预约","限免","精选","限时","节","抢","折","补贴","省钱"];
for (let index in deleteStr){
if($(this).text().match(deleteStr[index])){
$(this).closest("div.placeholder").remove();
}
}
});
}