Noto Color Emoji on all pages

Inject Noto Color Emoji font into css on all pages

  1. // ==UserScript==
  2. // @name Noto Color Emoji on all pages
  3. // @name:ru Эмодзи (Noto Color) на всех страницах
  4. // @description Inject Noto Color Emoji font into css on all pages
  5. // @description:ru Внедряет эмодзи (смайлы) из шрифта Noto Color Emoji в css на всех страницах
  6. // @version 1.02
  7. // @match *://*/*
  8. // @require https://code.jquery.com/jquery-3.5.1.min.js
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/718526
  11. // ==/UserScript==
  12. this.$ = this.jQuery = jQuery.noConflict(true);
  13.  
  14. $("html,head,body,tbody,br,div,td,span,li,p,.emoji").css("font-family", function(index,currentValue){
  15. if (currentValue.match(/Noto Color Emoji/i)) {
  16. return currentValue + ',Segoe UI Emoji';
  17. } else if (currentValue.match(/Segoe UI Emoji/i)) {
  18. return currentValue.replace(/Segoe UI Emoji/i,'noto color emoji') + ',Segoe UI Emoji';
  19. } else {
  20. return currentValue + ',noto color emoji,Segoe UI Emoji';
  21. }
  22. });
  23.  
  24. //ALTERNATIVE WAY (loads resources heavily even with the specified exceptions)
  25. //$("*:not(i):not(.fa):not(.fbar):not(.smart-form):not(input)").css("font-family", function(index,currentValue){
  26. //FULL EMOJI FONTS LIST (heavy)
  27. //return currentValue + ',sans-serif,noto color emoji,emoji,apple color emoji,segoe ui emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,twitter color emoji,segoe ui symbol';