1 2 3 4 5 6 7 8 9 10
module.exports = Ferdium => { const getMessages = () => { const button = document.querySelectorAll('[href="#unread"]')[0] ?? {}; const count = Ferdium.safeParseInt(button.textContent); Ferdium.setBadge(count); }; Ferdium.loop(getMessages); };