GitHub Hide Own Feed Meta

A userscript that hides your own repo metadata in the GitHub feed

目前為 2018-10-05 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name GitHub Hide Own Feed Meta
  3. // @version 0.1.4
  4. // @description A userscript that hides your own repo metadata in the GitHub feed
  5. // @license MIT
  6. // @author Rob Garrison
  7. // @namespace https://github.com/Mottie
  8. // @include https://github.com/
  9. // @run-at document-idle
  10. // @grant none
  11. // @require https://gf.qytechs.cn/scripts/28721-mutations/code/mutations.js?version=634242
  12. // @icon https://assets-cdn.github.com/pinned-octocat.svg
  13. // ==/UserScript==
  14. (() => {
  15. "use strict";
  16.  
  17. const feedClass = ".watch_started"; // starred; not sure about watch event
  18. // Set up user string as "/{user}/" to match the link's href
  19. const user = `/${document.querySelector('meta[name="user-login"]').getAttribute("content")}/`;
  20.  
  21. function init() {
  22. if (document.getElementById("dashboard")) {
  23. [...document.querySelectorAll(feedClass)].forEach(el => {
  24. // This is really fragile
  25. // div.border.rounded-1.p-3.my-2
  26. // > div (no class)
  27. // > span.f3.lh-condensed.text-bold.text-gray-dark
  28. // > a.link-gray-dark.text-bold.wb-break-all[data-ga-click]
  29. const link = el.querySelector("div.border a[data-ga-click]");
  30. if (link.href.indexOf(user) > 0) {
  31. link.closest("div.border").style.display = "none";
  32. }
  33. });
  34. // ghmo observer isn't set up to watch the feed... we'll work around it for now
  35. document.querySelector(".ajax-pagination-btn").addEventListener("click", () => {
  36. setTimeout(() => {
  37. init();
  38. }, 1500);
  39. });
  40. }
  41. }
  42.  
  43. document.addEventListener("ghmo:container", init);
  44. init();
  45. })();

QingJ © 2025

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