aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/hangoutschat/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/hangoutschat/webview.js')
-rw-r--r--recipes/hangoutschat/webview.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js
index 0f17116..0244d33 100644
--- a/recipes/hangoutschat/webview.js
+++ b/recipes/hangoutschat/webview.js
@@ -1,4 +1,4 @@
1module.exports = (Franz) => { 1module.exports = (Ferdi) => {
2 // class corresponding to the red badge that is visible for direct messages 2 // class corresponding to the red badge that is visible for direct messages
3 const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; 3 const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU';
4 4
@@ -12,10 +12,12 @@ module.exports = (Franz) => {
12 // get unread indirect messages 12 // get unread indirect messages
13 const indirectCount = Number(document.querySelector(indirectMessageSelector).innerText); 13 const indirectCount = Number(document.querySelector(indirectMessageSelector).innerText);
14 14
15 // set Franz badge 15 // set Ferdi badge
16 Franz.setBadge(directCount, indirectCount); 16 Ferdi.setBadge(directCount, indirectCount);
17 }; 17 };
18 18
19 Ferdi.loop(getMessages);
20
19 document.addEventListener('click', (e) => { 21 document.addEventListener('click', (e) => {
20 const { tagName, target, href } = e.target; 22 const { tagName, target, href } = e.target;
21 23
@@ -25,7 +27,4 @@ module.exports = (Franz) => {
25 window.open(href); 27 window.open(href);
26 } 28 }
27 }); 29 });
28
29 // check for new messages every second and update Franz badge
30 Franz.loop(getMessages);
31}; 30};