Fuck-Yudao

Block and disable a motherfucker's ignorance, bitchy and childish paywall for a so-called "Free & Open Source Software". If YunaiV is reading this, fuck you. China's OSS environment sucks because of losers like you. BTW your documentation sucks even more than your amateur level front-end skill, if you can even call it front-end.

目前為 2024-05-12 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Fuck-Yudao
// @namespace    none
// @version      0.1
// @license      MIT
// @description  Block and disable a motherfucker's ignorance, bitchy and childish paywall for a so-called "Free & Open Source Software". If YunaiV is reading this, fuck you. China's OSS environment sucks because of losers like you. BTW your documentation sucks even more than your amateur level front-end skill, if you can even call it front-end.
// @author       The fuck you care
// @match        https://www.iocoder.cn/*
// @match        https://doc.iocoder.cn/*
// @match        https://cloud.iocoder.cn/*
// @grant        unsafeWindow
// @grant        GM_addStyle
// @run-at document-end
// ==/UserScript==

(function() {
    'use strict';

    GM_addStyle('.alert-modal, .alert-container {height: 0 !important; opacity: 0 !important; display: none !important; z-Index: -9999 !important};');
    GM_addStyle('body { overflow: auto !important; height: 100vh; }');
    GM_addStyle('#app { overflow: auto !important; height: 100%; }');
    unsafeWindow.jqueryAlert = function() {};
    unsafeWindow.jQuery = function() {};

    let yudaosPoorlyWrittenDoc = null, oldLocation = document.location.pathname, oldIsBlock = null;
    const blockPathList = ['bpm', 'user-center', 'social-user', 'oauth2', 'saas-tenant', 'sms', 'mail', 'notify', 'mybatis-pro', 'dynamic-datasource', 'report', 'Spring-Boot', 'Spring-Cloud', 'api-doc', 'module-new', 'new-feature', 'dev-hot-swap', 'file', 'message-queue', 'job', 'idempotent', 'distributed-lock', 'rate-limiter', 'project-rename', 'delete-code', 'resource-permission', 'data-permission', 'deployment-linux', 'deployment-docker', 'mp', 'mall', 'pay', 'crm', 'member', 'erp', 'websocket', 'vo', 'system-log'];

    const isBlocked = () => {
        const ret = blockPathList.some((e) => document.location.pathname.includes(e));
        console.log(document.location);
        // oldIsBlock = ret;
        return ret;
    }

    let wrapperEl = document.querySelector('.content-wrapper');
    console.log(wrapperEl);
    if (wrapperEl) {
        yudaosPoorlyWrittenDoc = wrapperEl?.innerHTML;
        console.log('init', yudaosPoorlyWrittenDoc.substring(0, 2000));

        const urlObserver = new MutationObserver(() => {
            const _o = oldIsBlock;
            if (oldLocation !== document.location.pathname) {
                console.log('url changed');
                document.location.reload();
            }
        })

        urlObserver.observe(document.body, { childList: true, subtree: true })

        const contentObserver = new MutationObserver(() => {
            if (wrapperEl.innerText.includes('仅 VIP 可见') && !yudaosPoorlyWrittenDoc.includes('仅 VIP 可见')) {
                document.querySelector('.content-wrapper').innerHTML = yudaosPoorlyWrittenDoc;
                console.log('I will give people their freedom back!');
            }
        })

        if (isBlocked()) {
            contentObserver.observe(wrapperEl, { childList: true, characterData: true, subtree: true });
        } else {
            contentObserver.disconnect();
        }
    }
})();