Skip to content

Instantly share code, notes, and snippets.

@m-dango
Created April 19, 2016 20:40
Show Gist options
  • Save m-dango/4f487dcee7d04ba2f6d4c615812af668 to your computer and use it in GitHub Desktop.
Save m-dango/4f487dcee7d04ba2f6d4c615812af668 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Emoji One Color Font
// @namespace http://dango.space
// @description Insert Emoji One Color font into css on all pages
// @match *://*/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js
// @grant none
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$("body").css("font-family", function(index,currentValue){
if (currentValue.match(/Emoji One Color/i)) {
return;
} else if (typeof currentValue == 'undefined') {
return "Emoji One Color";
} else {
return '"Emoji One Color",' + currentValue;
}
});
@endolith
Copy link

endolith commented Jun 28, 2016

I had to modify this to say "EmojiOne Color", and then it works, but only on 1 page out of 5 that I've tried. Using the Font Finder extension I can see that it's modifying the font stack for the body element but not for the inner elements that aren't working.

Changing the browser's default font to Emoji One kind of works, but probably has side effects?

Copy link

ghost commented Mar 2, 2018

@endolith Replacing $("body") with $("*") makes it override emoji for every element, but I can't imagine it's easy on the browser.

Perhaps a userstyle of the form ```

  • {
    font-family: EmojiOne Color !important;
    }```
    would work?

@TheSlicingSword
Copy link

Where is this script supposed to be executed?

@m-dango
Copy link
Author

m-dango commented Jul 15, 2020

Where is this script supposed to be executed?

It would typically be run in a browser extension such as Greasemonkey/Tampermonkey, however I no longer use this personally.

@TheSlicingSword
Copy link

Where is this script supposed to be executed?

It would typically be run in a browser extension such as Greasemonkey/Tampermonkey, however I no longer use this personally.

What do you use now as a replacement/substitute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment