YouTube 404 page monkey replacer

Replaces the YouTube 404 page monkey with a better one made by @dinoboirex1.

  1. // ==UserScript==
  2. // @run-at document-idle
  3. // @version 1.0.0
  4. // @name YouTube 404 page monkey replacer
  5. // @namespace https://github.com/emmaexe/userscripts
  6. // @author emmaexe
  7. // @description Replaces the YouTube 404 page monkey with a better one made by @dinoboirex1.
  8. // @license GPL-3.0-only
  9. // @homepageURL https://github.com/emmaexe/userscripts
  10. // @supportURL https://github.com/emmaexe/userscripts/issues
  11. // @include *://youtube.*/*
  12. // @include *://*.youtube.*/*
  13. // @icon https://raw.githubusercontent.com/emmaexe/userscripts/main/youtube-404-replacer/assets/youtube-ico-32.png
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17. youtube_monke_parent = document.getElementsByClassName('not-found-content')[0];
  18. youtube_monke = document.getElementsByClassName('not-found-content__image')[0];
  19. if (youtube_monke === undefined) youtube_monke = document.getElementById('error-page-hh-illustration');
  20. if (youtube_monke != undefined) {
  21. youtube_monke.src = "https://raw.githubusercontent.com/emmaexe/userscripts/main/youtube-404-replacer/assets/youtube-monkey.png";
  22. youtube_monke.width = 186;
  23. youtube_monke.height = 186;
  24. let newAnchor = document.createElement("a");
  25. newAnchor.innerText = "\nArt by @dinoboirex1";
  26. newAnchor.href = "https://www.reddit.com/user/DinoRex_Makes_2/";
  27. newAnchor.target = "_blank";
  28. youtube_monke_parent.insertBefore(newAnchor, youtube_monke_parent.children[1]);
  29. }