GitHub Feed Back

Bring my GitHub feed back

  1. // ==UserScript==
  2. // @name GitHub Feed Back
  3. // @namespace https://github.com/Sec-ant
  4. // @version 0.1.5
  5. // @author Ze-Zheng Wu
  6. // @description Bring my GitHub feed back
  7. // @license MIT
  8. // @icon https://github.githubassets.com/favicons/favicon.svg
  9. // @homepage https://github.com/Sec-ant/github-feed-back
  10. // @homepageURL https://github.com/Sec-ant/github-feed-back
  11. // @source https://github.com/Sec-ant/github-feed-back.git
  12. // @supportURL https://github.com/Sec-ant/github-feed-back/issues
  13. // @match https://github.com/
  14. // @match https://github.com/?*
  15. // @match https://github.com/dashboard*
  16. // @run-at document-start
  17. // ==/UserScript==
  18.  
  19. (function () {
  20. 'use strict';
  21.  
  22. let isIncludeFragmentFound = false;
  23. let isFilterButtonFound = false;
  24. const observer = new MutationObserver((_, observer2) => {
  25. const includeFragment = document.querySelector(
  26. '[data-target="feed-container.content"] > include-fragment'
  27. );
  28. if (includeFragment) {
  29. includeFragment.setAttribute("src", "/dashboard-feed");
  30. isIncludeFragmentFound = true;
  31. }
  32. const filterButton = document.querySelector(
  33. '[data-target="feed-container.feedTitle"] + div'
  34. );
  35. if (filterButton) {
  36. filterButton.remove();
  37. isFilterButtonFound = true;
  38. }
  39. if (isIncludeFragmentFound && isFilterButtonFound) {
  40. observer2.disconnect();
  41. }
  42. });
  43. observer.observe(document.documentElement, {
  44. childList: true,
  45. subtree: true
  46. });
  47. document.addEventListener("DOMContentLoaded", () => {
  48. observer.disconnect();
  49. });
  50.  
  51. })();

QingJ © 2025

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