GitHub - open closed issues if there are no open issues

Automatically opens closed issues if there are no open issues on GitHub.

  1. // ==UserScript==
  2. // @name GitHub - open closed issues if there are no open issues
  3. // @namespace https://github.com/AbdurazaaqMohammed
  4. // @author Abdurazaaq Mohammed
  5. // @version 1.0
  6. // @description Automatically opens closed issues if there are no open issues on GitHub.
  7. // @match https://github.com/*/issues
  8. // @grant none
  9. // @run-at document-start
  10. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  11. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  12. // @license The Unlicense
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. if(document.querySelector('.selected.btn-link').textContent.trim().startsWith(0)) document.querySelector("#js-issues-toolbar > div > div.flex-auto.d-none.d-lg-block.no-wrap > div > a:nth-child(2)").click();
  19. })();