Fuck-Yudao

Help you climb over the paywall for a so-called "Free & Open Source Software", built by someone who truly understand our generations duty. To you-know-who: *thank you*. China's OSS environment got much better because of professionals like you.

  1. // ==UserScript==
  2. // @name Fuck-Yudao
  3. // @namespace none
  4. // @version 0.7
  5. // @license MIT
  6. // @description Help you climb over the paywall for a so-called "Free & Open Source Software", built by someone who truly understand our generations duty. To you-know-who: *thank you*. China's OSS environment got much better because of professionals like you.
  7. // @author The love you care
  8. // @match https://www.iocoder.cn/*
  9. // @match https://doc.iocoder.cn/*
  10. // @match https://cloud.iocoder.cn/*
  11. // @grant unsafeWindow
  12. // @run-at document-end
  13. // ==/UserScript==
  14.  
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. // Overwrite jqueryAlert, simply comment out `init` can disable the annoying dialog
  20. unsafeWindow.jqueryAlert = function(opts) {
  21. var dialog;
  22. dialog.show = function() {}
  23. // dialog.init();
  24. // dialog.close();
  25. return dialog;
  26. }
  27.  
  28.  
  29. // The content of yudao's pooly-written documentation. Almost at the same miserable level as uni-app's docs.
  30. // Read the docs of vue, react and a lot more responsible, real open source repos to learn how to make professional statements.
  31. let yudaosPoorlyWrittenDoc = null, prevPath = document.location.pathname;
  32. // The routes that are currently being marked as VIP only. Real jokes.
  33. 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/", "/http-sign/", "/project-rename/", "/delete-code/", "/resource-permission/", "/data-permission/", "/deployment-linux/", "/deployment-docker/", "/deployment-baota", "/registry-center/", "/config-center/", "/rpc/", "/gateway/", "/distributed-transaction/", "/server-protection/", "/cloud-debug/", "/mp/", "/mall/", "/pay/", "/crm/", "/member/", "/erp/", "/ai/", "/websocket/", "/vo/", "/system-log/"];
  34.  
  35. // If the current url is 'blocked'.
  36. // You do know that for a static documentation site nothing is really blocked, don't you
  37. const isBlocked = () => {
  38. const ret = blockPathList.some((e) => document.location.pathname.includes(e));
  39. return ret;
  40. }
  41.  
  42. // Get the documentation content wrapper element
  43. const getWrapper = () => {
  44. return document.querySelector('.content-wrapper');
  45. }
  46.  
  47. const replace = (str) => {
  48. const wrapper = getWrapper()
  49. if (str) {
  50. while (wrapper.innerHTML !== str) {
  51. wrapper.innerHTML = str
  52. }
  53. }
  54. }
  55.  
  56. const contentObserver = new MutationObserver(() => {
  57. if (getWrapper().innerHTML.includes('仅 VIP 可见')) {
  58. replace(yudaosPoorlyWrittenDoc)
  59. }
  60. })
  61.  
  62. const urlObserver = new MutationObserver(() => {
  63. const wrapperEl = getWrapper()
  64. /*
  65. if (document.location.href !== 'https://doc.iocoder.cn/' && isBlocked() && !window.location.href.includes('refreshed')) {
  66. window.location.href = window.location.href + '?refreshed=1'
  67. // window.location.reload();
  68. }
  69. */
  70. if (prevPath !== document.location.pathname) {
  71. window.location.reload()
  72. }
  73. })
  74.  
  75. urlObserver.observe(document.body, { childList: true })
  76.  
  77. //=============================================================================================================================================
  78.  
  79. const $$wrapper = getWrapper();
  80. if (getWrapper() && isBlocked()) {
  81. yudaosPoorlyWrittenDoc = $$wrapper.innerHTML.includes('仅 VIP 可见') ? null : $$wrapper.innerHTML;
  82. unsafeWindow.$$content = yudaosPoorlyWrittenDoc;
  83. unsafeWindow.$$replace = function() {
  84. replace(unsafeWindow.$$content)
  85. }
  86. contentObserver.observe($$wrapper, { childList: true, characterData: true, subtree: true });
  87. replace(yudaosPoorlyWrittenDoc);
  88. }
  89.  
  90. //=============================================================================================================================================
  91.  
  92. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址