Created
October 24, 2024 09:51
-
-
Save justsml/f29ebc040e564fb1b33f13c8ed2634be to your computer and use it in GitHub Desktop.
SLACK EMOJI BROWSER SCRIPTS
This file contains hidden or 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
// 1. Run in console on slack emoji admin page, | |
// 2. scroll your entire list | |
// 3. when done run `stopCapture()` for your Emoji names + URLs | |
var emojis = {}; | |
var $timer = setInterval(captureEmojis, 50); | |
function captureEmojis() { | |
document.querySelectorAll(".p-customize_emoji_list__image").forEach((el) => { | |
emojis[el.alt] = el.src; | |
}); | |
} | |
function stopCapture() { | |
clearInterval($timer); | |
console.dir(emojis); | |
} |
This file contains hidden or 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
// This script makes it very fast to drag and drop files into the Slack Emoji Admin page | |
var isModalOpen = () => Boolean(document.querySelector('.ReactModal__Content--after-open')) | |
function openModal() { | |
var addBtn = document.querySelector('[data-qa="customize_emoji_add_button"]') | |
// modal closed, open it again | |
if (addBtn) addBtn.click() | |
} | |
var $timer = setInterval(() => { | |
if (isModalOpen()) { | |
var visibleForm = document.querySelector('.p-add_custom_emoji_dialog__form') | |
if (visibleForm) { | |
// clearInterval($timer) | |
var fileName = document.querySelector('.p-add_custom_emoji_dialog__filename')?.innerHTML; | |
if (fileName) { | |
// auto save! | |
var saveModalButton = document.querySelector('[data-qa="customize_emoji_add_dialog_go"]') | |
saveModalButton.click() | |
// auto open, fast | |
setTimeout(openModal, 120) | |
} | |
} | |
} else { | |
openModal() | |
} | |
}, 100); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment