赤石啊 GitCode

GitCode自动重定向到GitHub, 拒绝赤石

  1. // ==UserScript==
  2. // @name 赤石啊 GitCode
  3. // @name:zh-CN 赤石啊 GitCode
  4. // @name:zh-HK 吔屎啊 GitCode
  5. // @description GitCode自动重定向到GitHub, 拒绝赤石
  6. // @description:zh-CN GitCode自动重定向到GitHub, 拒绝赤石
  7. // @description:zh-HK GitCode自動重定向至GitHub
  8. // @namespace Violentmonkey Scripts
  9. // @author TC999,原作者qby(https://greasyfork.org/zh-CN/users/844141-cubewhy)
  10. // @match https://gitcode.com/*
  11. // @grant none
  12. // @version 1.2.1
  13. // @license MIT
  14. // @icon https://cdn-static.gitcode.com/static/images/logo-favicon.png
  15. // ==/UserScript==
  16. console.log("Fuck you GitCode!");
  17.  
  18. function exec() {
  19. let target = "https://gitcode.com/Gitcode-offical-team/GitCode-Docs/issues/198"
  20. if (window.location.href == target){
  21. return;
  22. }
  23. alert("傻逼GitCode");
  24. if (window.location.pathname == "/") {
  25. window.location.href = target
  26. } else {
  27. let remove = window.location.pathname.replace('/overview','');// 删除地址末尾
  28. window.location.href = "https://github.com" + remove;
  29. }
  30. }
  31.  
  32. exec()