aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/tweetdeck/webview.js
blob: b60415dfb0fae4a00aeb15f89d39fe113d269495 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Tweetdeck redirect fix
Ferdi.ipcRenderer.on('redirect-url', (event, url) => {
  window.location.assign(url);
});

module.exports = Ferdi => {
  const getMessages = function getMessages() {
    const elements = document.querySelectorAll('.msg-unread-count');
    let count = 0;
    if (elements[0]) {
      count = Ferdi.safeParseInt(elements[0].innerHTML);
    }

    Ferdi.setBadge(count);
  };

  Ferdi.loop(getMessages);
};