aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/proton-mail/webview.js
blob: 241730936cf17c8e385392b5d3a1bff2878af032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
module.exports = Franz => {
  function getMessages() {
    const element = document.querySelector('.navigationItem-counter');
    if (!element) {
      return;
    }
    const text = element.innerText;
    const count = Number(text.substring(1, text.length - 1));
    Franz.setBadge(count);
  }

  Franz.loop(getMessages);
};