Skip to content

Instantly share code, notes, and snippets.

@MicahZoltu
Last active October 21, 2021 08:18
Show Gist options
  • Save MicahZoltu/6946096153eb20ce16a50bb2de16dbb2 to your computer and use it in GitHub Desktop.
Save MicahZoltu/6946096153eb20ce16a50bb2de16dbb2 to your computer and use it in GitHub Desktop.
Reaction Hotkey for various chat clients.
window.addEventListener('keydown', event => {
if (!event.shiftKey || !event.ctrlKey || event.key != '|') return
const container = document.querySelector('main > div:first-of-type > div:first-of-type > div:first-of-type > ol > li:last-of-type > div')
container.dispatchEvent(new MouseEvent('mousemove', { bubbles: true }));
container.querySelector('div[aria-label="Add Reaction"]').click()
})
window.addEventListener('keydown', event => { if (event.shiftKey && event.ctrlKey && event.key == '|') { document.querySelector('.messages-box > .wrapper > ul > li:last-of-type > .message-actions > .message-actions__buttons > .message-actions__button').click(); document.querySelector('.emoji-picker > .emoji-top > .rc-input > .rc-input__label > .rc-input__wrapper > input.rc-input__element').focus(); document.querySelector('.emoji-picker > .emoji-top > .rc-input > .rc-input__label > .rc-input__wrapper > input.rc-input__element').value = '' } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment