// ==UserScript== // @name 禁用VIKACG网址安全检查 // @version 1.0 // @description 在网页加载后自动修改加密后的网址检查网址 // @author xsap // @match https://www.vikacg.com/p/* // @grant none // @namespace NoVikUrlBlock // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/504407/%E7%A6%81%E7%94%A8VIKACG%E7%BD%91%E5%9D%80%E5%AE%89%E5%85%A8%E6%A3%80%E6%9F%A5.user.js // @updateURL https://update.greasyfork.icu/scripts/504407/%E7%A6%81%E7%94%A8VIKACG%E7%BD%91%E5%9D%80%E5%AE%89%E5%85%A8%E6%A3%80%E6%9F%A5.meta.js // ==/UserScript== (function() { 'use strict'; // Function to perform decryption function decrypt(encryptedUrl) { const key = CryptoJS.enc.Utf8.parse("7R75R3JZE2PZUTHH"); const iv = CryptoJS.enc.Utf8.parse("XWO76NCVZM2X1UCU"); const encryptedBase64 = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(encryptedUrl)); const decrypted = CryptoJS.AES.decrypt(encryptedBase64, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }); return decrypted.toString(CryptoJS.enc.Utf8); } // Function to update all matching tags function updateLinks() { document.querySelectorAll('a[href^="/external?e="]').forEach(link => { const encryptedUrl = new URL(link.href, window.location.origin).searchParams.get('e'); if (encryptedUrl) { const decryptedUrl = decrypt(encryptedUrl); link.href = decryptedUrl; } }); } // Import CryptoJS library const script = document.createElement('script'); script.src = 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/crypto-js/4.1.1/crypto-js.min.js'; script.onload = function() { // Initial update updateLinks(); // Set up a MutationObserver to watch for DOM changes const observer = new MutationObserver(updateLinks); observer.observe(document.body, { childList: true, // Observe direct children subtree: true, // Observe entire subtree attributes: true, // Observe attribute changes attributeFilter: ['href'] // Only observe 'href' attribute changes }); }; document.head.appendChild(script); })();