diff options
Diffstat (limited to 'recipes/jitsi')
-rw-r--r-- | recipes/jitsi/index.js | 9 | ||||
-rw-r--r-- | recipes/jitsi/webview.js | 20 |
2 files changed, 13 insertions, 16 deletions
diff --git a/recipes/jitsi/index.js b/recipes/jitsi/index.js index 6e3a728..8de4268 100644 --- a/recipes/jitsi/index.js +++ b/recipes/jitsi/index.js | |||
@@ -1,6 +1,5 @@ | |||
1 | "use strict"; | ||
2 | module.exports = Franz => class Jitsi extends Franz { | 1 | module.exports = Franz => class Jitsi extends Franz { |
3 | overrideUserAgent() { | 2 | overrideUserAgent() { |
4 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); |
5 | } | 4 | } |
6 | } \ No newline at end of file | 5 | }; |
diff --git a/recipes/jitsi/webview.js b/recipes/jitsi/webview.js index 563a3cf..69c468e 100644 --- a/recipes/jitsi/webview.js +++ b/recipes/jitsi/webview.js | |||
@@ -1,14 +1,12 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; | 1 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; |
4 | 2 | ||
5 | module.exports = Ferdi => { | 3 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 4 | const getMessages = () => { |
7 | const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; | 5 | const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; |
8 | const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); | 6 | const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); |
9 | 7 | ||
10 | Ferdi.setBadge(messages); | 8 | Ferdi.setBadge(messages); |
11 | } | 9 | }; |
12 | 10 | ||
13 | Ferdi.loop(getMessages); | 11 | Ferdi.loop(getMessages); |
14 | } \ No newline at end of file | 12 | }; |