Greasy Fork is available in English.

userscript-github-close-404

Auto-closes GitHub repo pages that return a 404 error.

  1. // ==UserScript==
  2. // @name userscript-github-close-404
  3. // @namespace https://github.com/mefengl
  4. // @version 0.0.2
  5. // @description Auto-closes GitHub repo pages that return a 404 error.
  6. // @author mefengl
  7. // @match https://github.com/*/*
  8. // @license MIT
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. var errorImage = document.querySelector('img[alt="404 “This is not the web page you are looking for”"]');
  16. if (errorImage) {
  17. window.close();
  18. }
  19. })();