// ==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();
}
}
})();