Greasy Fork 支持简体中文。

Fuck Yudao

屏蔽芋道官方文档登录校验

  1. // ==UserScript==
  2. // @name Fuck Yudao
  3. // @namespace none
  4. // @version 0.2
  5. // @license MIT
  6. // @description 屏蔽芋道官方文档登录校验
  7. // @author York Wang
  8. // @match https://www.iocoder.cn/*
  9. // @match https://doc.iocoder.cn/*
  10. // @match https://cloud.iocoder.cn/*
  11. // @grant GM_xmlhttpRequest
  12. // @grant unsafeWindow
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. if(document.location.href.startsWith("https://www.iocoder.cn/")) {
  19. // Official Website
  20. unsafeWindow.isVIP = function(){return true}
  21. unsafeWindow.jqueryAlert = ()=>{console.log('fuck yudao');return {close:()=>{}}}
  22. const locker = document.querySelector("#locker")
  23. if(locker) {
  24. locker.style.display = 'none'
  25. }
  26. const content = document.querySelector("#post-body")
  27. if(content) {
  28. content.style.height = 'auto'
  29. }
  30. } else {
  31. // Official Documents
  32. let src = ''
  33. const scripts = document.querySelectorAll("script[src]")
  34. for (let i = 0; i < scripts.length; ++i) {
  35. if(scripts[i].src.indexOf('/assets/js/app') > -1) {
  36. src = scripts[i].src
  37. }
  38. }
  39. if(src) {
  40. GM_xmlhttpRequest({
  41. method: 'GET',
  42. url: src,
  43. onload: res => {
  44. // const a="88974ed8-6aff-48ab-a7d1-4af5ffea88bb",r="shao";function c(){return(Cookies.get(a) ...
  45. const key = res.responseText.match(/const \w="([\w-]+)",\w="(\w+)";/)
  46. if(key.length > 2) {
  47. if(document.cookie.indexOf(key[1]) === -1) {
  48. document.cookie = key[1] + '=' + key[2] + ';path=/'
  49. location.reload()
  50. }
  51. }
  52. }
  53. })
  54. }
  55. }
  56. })();