// ==UserScript== // @name [个人工具]移除广告、好用网站收藏 // @namespace http://tampermonkey.net/ // @version 1.6 // @description 适用于 svip.bljiex.cc、www.ysgc.vip 拦截页面广告,谷歌广告 // @author Godow // @match *://*/* // @run-at document-body // @icon https://goduck.cc/favicon.ico // @grant none // @license MIT // @downloadURL none // ==/UserScript== // 我的主页,常用网站收藏 const myHome = () => { document.querySelectorAll("body *").forEach(i => i.remove()); const myLink = { "影视工厂": "//www.ysgcapp.com/", "BL解析": "//svip.bljiex.cc", "照片转卡通": "//www.toonme.com", "图片智能擦除": "//magicstudio.com/magiceraser", "图片消除背景": "//www.remove.bg/zh", "红白机游戏": "//www.yikm.net/", "在线鼠标作图": "//weavesilk.com/", "改图鸭": "//www.gaituya.com/manhua/", }; Object.keys(myLink).forEach(i => { let a = document.createElement('a'); a.href = myLink[i]; a.appendChild(document.createTextNode(i)); a.style = "margin: 20px 50px;display: inline-block"; document.body.appendChild(a); }) } // 跳过中间页 const jumpMidPage = () => { if (/\?target\=http/.test(location.href)) { const targetUrl = decodeURIComponent(location.href).match(/(?<=target\=http).+/)?.[0]?.split(':')?.[1]; if (targetUrl) { location.href = targetUrl; } } } (function() { 'use strict'; jumpMidPage(); const host = document.location.host; let fn; switch(host) { case '0000.com': fn = myHome; break; // BL解析 case 'svip.bljiex.cc': fn = () => { document.querySelectorAll('#section~*')?.forEach(i => i.remove()); }; break; // 影视工厂 case 'www.ysgc.vip': case 'www.ysgc.fun': case 'www.ysgc1.cc': case 'www.ysgc2.cc': fn = () => { document.querySelectorAll('a[target="_blank"],#HMRichBox,#mhbottom_ad_box,#fulerbox,#hm_cpm_show,#fix_bottom_dom,div[id*="ad"]')?.forEach(i => i.remove()); document.querySelector(".col-lg-wide-75 > .myui-panel").style = "display: none"; }; break; default: // 删除谷歌广告 fn = () => { document.querySelectorAll(".adsbygoogle").forEach(i => i.remove()); } break; } if (fn) { const timerFn = (interval, count) => { const timer = setInterval(() => { fn(); if((--count) < 0) { clearInterval(timer); } }, interval) } timerFn(100, 5); timerFn(800, 3); } })();