aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/instagram/webview.js
blob: be543175eda493e5ae095ecec6536cad5e7bb463 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const path = require('path');

module.exports = (Franz) => {
  const getMessages = function getMessages() {
    const element = document.querySelector('a[href^="/direct/inbox"]');

    if (element) {
      Franz.setBadge(parseInt(element.innerText, 10));
    }
  };

  Franz.loop(getMessages);

  Franz.injectCSS(path.join(__dirname, 'service.css'));
};