您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
// ==UserScript== // @name Sketchup.cgtips.org link extractor // @namespace http://tampermonkey.net/ // @version 0.3 // @description try to take over the world! // @author You // @match https://sketchup.cgtips.org/* // @match https://link.cgtips.org/* // @icon https://www.google.com/s2/favicons?sz=64&domain=cgtips.org // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; function verifySite(site) { return window.location.hostname.includes(site); } function cgtipsSiteBypass() { let varText = document.querySelectorAll('code')[0].childNodes; let mthString = "link.cgtips"; let data=""; for (let idx = 0; idx < varText.length; idx++) { let el = varText[idx]; if (el.nodeType == Node.TEXT_NODE) { var opUrl = el.textContent.trimStart(); if (opUrl.includes(mthString)) { data = opUrl; break; } } } console.log("DOWNLOAD URL : "+ data); window.location = data; } function waitForElement(selector, callback) { const observer = new MutationObserver((mutations) => { const element = document.querySelector(selector); if (element) { observer.disconnect(); callback(element); } }); observer.observe(document.body, { childList: true, subtree: true }); } //-------------EXECUTE----------------\\ document.addEventListener("beforeload", (event) => { const blockedScripts = ["sodar2.js", "analytics.js","adsbygoogle.js"]; blockedScripts.forEach((blockedSrc) => { if (event.target.src.includes(blockedSrc)) { event.preventDefault(); // Block the script console.log(`Blocked: ${event.target.src}`); } }); }, true); if (verifySite("sketchup.cgtips.org")) { cgtipsSiteBypass(); } if (verifySite("link.cgtips.org")) { waitForElement('a.btn.btn-success', (el) => { console.log("Element found:", el.href); window.location = el.href; }); } // Your code here... })();