Better YouTube favicon

Replaces the meaningless play symbol with a YouTube-text favicon. / Ersetzt das nichtssagende Play-Symbol mit einem Youtube-Text-Favicon.

目前为 2014-05-18 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Better YouTube favicon
  3. // @namespace 969a1cf76bf42aaaa5a210792ebb18a9
  4. // @include http://youtube.com/*
  5. // @include https://youtube.com/*
  6. // @include http://*.youtube.com/*
  7. // @include https://*.youtube.com/*
  8. // @include http://youtube-nocookie.com/*
  9. // @include https://youtube-nocookie.com/*
  10. // @include http://*.youtube-nocookie.com/*
  11. // @include https://*.youtube-nocookie.com/*
  12. // @include http://youtu.be/*
  13. // @include https://youtu.be/*
  14. // @include http://*.youtu.be/*
  15. // @include https://*.youtu.be/*
  16. // @version 1
  17. // @grant none
  18. // @description Replaces the meaningless play symbol with a YouTube-text favicon. / Ersetzt das nichtssagende Play-Symbol mit einem Youtube-Text-Favicon.
  19. // ==/UserScript==
  20.  
  21. /* Dieses Skript steht unter CC0 / This script is licensed under CC0:
  22. * http://creativecommons.org/publicdomain/zero/1.0/deed.de
  23. * http://creativecommons.org/publicdomain/zero/1.0/deed.en */
  24.  
  25. // *** Einstellungen / Settings ***
  26. // * Favicon URL *
  27. var favicurl = "data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAIDZEJCA2RoggNkcwIDZHMCA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R/wgNkdgIDZHMCA2RzAgNkYQIDZEGCA6VhwgOlf//////CA6V/wgOlf///////////wgOlf///////////wgOlf8IDpX/CA6V////////////CA6VhwkOmcwJDpn//////wkOmf//////CQ6Z//////8JDpn//////wkOmf//////CQ6Z//////8JDpn/CQ6Z/wkOmcwJDp7qCQ6e//////8JDp7//////xMXnf//////Exed//////8JDpv//////wkOnv////////////////8JDp7qCQ+q/wkPqv//////CQ+q//////8WG6n//////xYbqf//////Fhup//////8JD6r//////wkPqv//////CQ+q/woRu+oKEbv//////woRu///////GB++//////8YH77///////////8KEbv/ChG7/woRu///////ChG7/woRu+oKEcDMChHA//////8KEcD/ChHA/xAXwf8QF8H/EBfB//////8QF8H/ChHA/woRwP8KEcD/ChHA/woRwP8KEcDMCxHEh////////////////wsRxP8LEcT/CxHE/wsRxP//////CxHE/woRwP8KEcD/CxHE/wsRxP8LEcT/CxHEh////5cLEsilCxLIzAsSyPkLEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyNILEsjMCxLIov///5f///+X////l////5cAAAD/////l////5f///+XAAAA/wAAAP////+X////l////5cAAAD/AAAA/wAAAP////+X////l////5f///+XAAAA/////5f///+XAAAA/////5f///+XAAAA/////5cAAAD/////l////5cAAAD/////l////5f///+X////lwAAAP////+X////lwAAAP////+X////lwAAAP////+XAAAA/////5f///+XAAAA/////5f///+X////l////5cAAAD/////l////5cAAAD/////l////5cAAAD/////lwAAAP////+X////lwAAAP////+X////l////5cAAAD/////lwAAAP////+X////lwAAAP8AAAD/////l////5cAAAD/////l////5cAAAD/////l////5cAAAD/////l////5f///+XAAAA/////5f///+X////l////5f///+X////l////5f///+X////l////5f///+XAAAA/////5f///+X////lwAAAP////+X////l////5f///+X////l////5f///+X////l////5f///+XgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
  28. // * Favicon-Dateityp / Favicon file type *
  29. var favictyp = "image/x-icon";
  30. // * Favicon ueberschreiben, falls vorhanden / Overwrite favicon, if one is set *
  31. var overwrite = true;
  32. // *** Ende der Einstellungen / End of settings ***
  33.  
  34. var iconset = false;
  35. for (var i = 0; i < window.document.getElementsByTagName('link').length; i++) {
  36. if (window.document.getElementsByTagName('link')[i].rel == "icon" || window.document.getElementsByTagName('link')[i].rel == "shortcut icon") {
  37. iconset = true;
  38. if (overwrite) {
  39. window.document.getElementsByTagName('link')[i].parentNode.removeChild(window.document.getElementsByTagName('link')[i]);
  40. iconset = false;
  41. }
  42. }
  43. }
  44. if (!iconset) {
  45. var favicon = window.document.createElement('link');
  46. favicon.rel = "shortcut icon";
  47. favicon.type = favictyp;
  48. favicon.href = favicurl;
  49. window.document.getElementsByTagName('head')[0].appendChild(favicon);
  50. }