1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
"use strict"; module.exports = Franz => { const getMessages = function getMessages() { const { title } = document; const regex = /\d+/; if (regex.test(title)) { Franz.setBadge( Number(regex.exec(title)[0]) ); } else { Franz.setBadge(0); } }; Franz.loop(getMessages); };