Better YouTube favicon

Replaces the meaningless play symbol with a YouTube-text favicon.

当前为 2015-08-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Better YouTube favicon
  3. // @name:de Besseres YouTube-Favicon
  4. // @namespace tfr
  5. // @description Replaces the meaningless play symbol with a YouTube-text favicon.
  6. // @description:de Ersetzt das nichtssagende Play-Symbol mit einem Youtube-Text-Favicon.
  7. // @license CC0; https://creativecommons.org/publicdomain/zero/1.0/
  8. // @compatible firefox Works with Firefox and Greasemonkey
  9. // @compatible chrome Works with Chrome and Tampermonkey
  10. // @incompatible opera Does not work with Opera and Tampermonkey Beta or Violent monkey
  11. // @oujs:author tfr
  12. // @include http://youtube.com/*
  13. // @include https://youtube.com/*
  14. // @include http://*.youtube.com/*
  15. // @include https://*.youtube.com/*
  16. // @include http://youtube-nocookie.com/*
  17. // @include https://youtube-nocookie.com/*
  18. // @include http://*.youtube-nocookie.com/*
  19. // @include https://*.youtube-nocookie.com/*
  20. // @include http://youtu.be/*
  21. // @include https://youtu.be/*
  22. // @include http://*.youtu.be/*
  23. // @include https://*.youtu.be/*
  24. // @version 2
  25. // @grant none
  26. // ==/UserScript==
  27.  
  28. /* Version 2: Update metadata, add German description */
  29.  
  30. /* Dieses Skript steht unter CC0 / This script is licensed under CC0:
  31. * http://creativecommons.org/publicdomain/zero/1.0/deed.de
  32. * http://creativecommons.org/publicdomain/zero/1.0/deed.en */
  33.  
  34. // *** Einstellungen / Settings ***
  35. // * Favicon URL *
  36. 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==";
  37. // * Favicon-Dateityp / Favicon file type *
  38. var favictyp = "image/x-icon";
  39. // * Favicon ueberschreiben, falls vorhanden / Overwrite favicon, if one is set *
  40. var overwrite = true;
  41. // *** Ende der Einstellungen / End of settings ***
  42.  
  43. var iconset = false;
  44. for (var i = 0; i < window.document.getElementsByTagName('link').length; i++) {
  45. if (window.document.getElementsByTagName('link')[i].rel == "icon" || window.document.getElementsByTagName('link')[i].rel == "shortcut icon") {
  46. iconset = true;
  47. if (overwrite) {
  48. window.document.getElementsByTagName('link')[i].parentNode.removeChild(window.document.getElementsByTagName('link')[i]);
  49. iconset = false;
  50. }
  51. }
  52. }
  53. if (!iconset) {
  54. var favicon = window.document.createElement('link');
  55. favicon.rel = "shortcut icon";
  56. favicon.type = favictyp;
  57. favicon.href = favicurl;
  58. window.document.getElementsByTagName('head')[0].appendChild(favicon);
  59. }