aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/freshdesk/webview.js
blob: e1911d03f85b5fc74b6d938f4fae8f9f1bcebe93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module.exports = Ferdi => {
  const getMessages = () => {
    $.get('/api/_/tickets?filter=unresolved', (data) => {
      Ferdi.setBadge(data.tickets.length);
    });
  };

  Ferdi.loop(getMessages);

/* block popups (prevents freshconnect from opening in a new window) */
  window.open = (function(url, name) {
    console.log(`blocked window.open(${url}, ${name})`);
  });
};