GitHub: involved issues

Make the Pulls and Issues links show your involved issues

  1. // ==UserScript==
  2. // @name GitHub: involved issues
  3. // @namespace https://akinori.org
  4. // @description Make the Pulls and Issues links show your involved issues
  5. // @license 2-clause BSDL
  6. // @author Akinori MUSHA
  7. // @include https://github.com/*
  8. // @version 1.0.3
  9. // @homepage https://github.com/knu/userjs-github_involved_issues
  10. // @homepage https://gf.qytechs.cn/scripts/25200-github-involved-issues
  11. // @grant none
  12.  
  13. // ==/UserScript==
  14. "use strict";
  15. (function () {
  16. const meta = document.querySelector("meta[name=user-login]")
  17.  
  18. if (!meta)
  19. return
  20.  
  21. const user = meta.content
  22. const encode = function (decoded) {
  23. return encodeURIComponent(decoded).replace(/%20/g, "+")
  24. }
  25.  
  26. const links = document.querySelectorAll("header ul li a")
  27. for (let i = 0; i < links.length; i++) {
  28. const href = links[i].getAttribute("href")
  29. switch (href) {
  30. case "/pulls":
  31. links[i].setAttribute("href", href + "?q=" + encode("is:open is:pr involves:" + user + " sort:updated-desc"))
  32. break
  33. case "/issues":
  34. links[i].setAttribute("href", href + "?q=" + encode("is:open is:issue involves:" + user + " sort:updated-desc"))
  35. break
  36. }
  37. }
  38. })();

QingJ © 2025

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