aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/yahoo-mail/webview.js
blob: fd5add18be76ee6537d49585b375120672011a0e (plain) (blame)
1
2
3
4
5
6
7
8
9
module.exports = (Franz) => {
  const getMessages = function getMessages() {
    const count = document.querySelector('a[data-test-folder-name="Inbox"]').getAttribute('data-test-unread-count');
    Franz.setBadge(count);
  };

  // check for new messages every second and update Franz badge
  Franz.loop(getMessages);
};