Created
December 12, 2021 23:47
-
-
Save GwyndolynMarchant/27865afd2d780cc787361f2d7b71b230 to your computer and use it in GitHub Desktop.
Native Emoji on Mastodon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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