Github Dashboard Filter

Minimizes pushs and commits from github actions and bots from github.com dashboard

  1. // ==UserScript==
  2. // @name Github Dashboard Filter
  3. // @description Minimizes pushs and commits from github actions and bots from github.com dashboard
  4. // @namespace RyoLee
  5. // @author RyoLee
  6. // @version 1.3
  7. // @copyright 2022, RyoLee (https://github.com/RyoLee)
  8. // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
  9. // @icon https://github.githubassets.com/pinned-octocat.svg
  10. // @match https://github.com/
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict'
  16.  
  17. function hideBots () {
  18. document.querySelectorAll('#dashboard div.push:not(.shotBot), #dashboard div.Details:not(.shotBot)').forEach(function (div) {
  19. const label = div.querySelector('.body .d-flex .d-flex .Label')
  20. const isAppUrl = div.querySelector('.body .d-flex .d-flex a.Link--primary[href^="/apps/"]')
  21. if (isAppUrl || (label && label.textContent === 'bot')) {
  22. div.style.display = 'none'
  23. }
  24. })
  25. }
  26.  
  27. hideBots()
  28. const iv = window.setInterval(hideBots, 200)
  29. window.setTimeout(() => window.clearInterval(iv), 5000)
  30. window.setInterval(hideBots, 4000)
  31. })()