Skip to content

Instantly share code, notes, and snippets.

@GwyndolynMarchant
Created December 12, 2021 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GwyndolynMarchant/27865afd2d780cc787361f2d7b71b230 to your computer and use it in GitHub Desktop.
Save GwyndolynMarchant/27865afd2d780cc787361f2d7b71b230 to your computer and use it in GitHub Desktop.
Native Emoji on Mastodon
// ==UserScript==
// @name Native Emoji - Mastodon
// @namespace shadenexus
// @version 0.1
// @description Replace emoji images with glyphs
// @author Gwyndolyn Marchant
// @match slime.global
// @grant none
// ==/UserScript==
(function() {
'use strict';
var ready = true;
function replaceEmoji() {
if (!ready) return;
ready = false;
setTimeout(() => { ready = true }, 50);
const matches = document.querySelectorAll("img.emojione:not(.custom-emoji)");
matches.forEach(i => i.replaceWith(document.createTextNode(i.alt)));
}
window.addEventListener("scroll", replaceEmoji);
document.querySelector("div.columns-area__panels__main").addEventListener("mousemove", replaceEmoji);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment