const start = () => { // if there is no chat if (document.querySelector("div[data-a-target=chat-input]") == null) { return; } const channelName = getChannelName(); if (!channelName) { return; } getTinyEmotesUserByName("https://alright.party", channelName) .then((x) => { console.log(x); }); }; function onPageReady(cb) { if (document.readyState === 'complete' || document.readyState === 'interactive') { cb(); } else { document.addEventListener("DOMContentLoaded", db); } } onPageReady(start);