Created
March 10, 2024 23:27
-
-
Save lpimem/d94c32d5ca612b7abe672c21bc43a439 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Ads | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-03-10 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.1point3acres.com/bbs/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=1point3acres.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function clean() { | |
// find ads links | |
const links = document.getElementsByTagName("a"); | |
const ads = []; | |
for (var i=0; i<links.length; i++) { | |
const a = links.item(i); | |
const href = a.href; | |
if (href.startsWith("https://link.1p3a.com/") || a.text.trim() == "[详情]") { | |
ads.push(a); | |
} | |
} | |
ads.forEach((a) => { | |
a.parentElement.style = "display: none; visibility: hidden;"; | |
console.info(`Removed: ${a.text}`); | |
}); | |
} | |
setTimeout(clean, 200); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment