aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/freshdesk/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/freshdesk/webview.js')
-rw-r--r--recipes/freshdesk/webview.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/recipes/freshdesk/webview.js b/recipes/freshdesk/webview.js
new file mode 100644
index 0000000..884bfb6
--- /dev/null
+++ b/recipes/freshdesk/webview.js
@@ -0,0 +1,14 @@
1module.exports = Ferdi => {
2 const getMessages = function getMessages() {
3 $.get('/api/_/tickets?filter=unresolved', (data) => {
4 Ferdi.setBadge(data.tickets.length);
5 });
6 };
7
8 Ferdi.loop(getMessages);
9
10/* block popups (prevents freshconnect from opening in a new window) */
11 window.open = (function(url, name) {
12 console.log(`blocked window.open(${url}, ${name})`);
13 });
14};