Greasy Fork 支持简体中文。

禁用VIKACG网址安全检查

在网页加载后自动修改加密后的网址检查网址

// ==UserScript==
// @name         禁用VIKACG网址安全检查
// @version      1.0
// @description  在网页加载后自动修改加密后的网址检查网址
// @author       xsap
// @match        https://www.vikacg.com/p/*
// @grant        none
// @namespace    NoVikUrlBlock
// @license      MIT
// ==/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 <a> 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);
})();