diff options
author | 2021-02-21 11:24:07 +0100 | |
---|---|---|
committer | 2021-02-21 11:24:07 +0100 | |
commit | 6ce9db9026c9d30df49e1dffee33cc6a69d271bb (patch) | |
tree | 096c56a5c89d72130733d5c37a3f28b70ed3498f /recipes/webex-teams/webview.js | |
parent | Add recipe for Canvas (#437) (diff) | |
download | ferdium-recipes-6ce9db9026c9d30df49e1dffee33cc6a69d271bb.tar.gz ferdium-recipes-6ce9db9026c9d30df49e1dffee33cc6a69d271bb.tar.zst ferdium-recipes-6ce9db9026c9d30df49e1dffee33cc6a69d271bb.zip |
Add recipe for Webex Teams (#435)
Diffstat (limited to 'recipes/webex-teams/webview.js')
-rw-r--r-- | recipes/webex-teams/webview.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/recipes/webex-teams/webview.js b/recipes/webex-teams/webview.js new file mode 100644 index 0000000..bcce61b --- /dev/null +++ b/recipes/webex-teams/webview.js | |||
@@ -0,0 +1,22 @@ | |||
1 | module.exports = (Franz) => { | ||
2 | const getMessages = function getMessages() { | ||
3 | let count = 0; | ||
4 | |||
5 | let span = document.getElementsByClassName('navigation-list-item--badgeCount'); | ||
6 | |||
7 | if (span.length == 0) { | ||
8 | span = document.getElementsByClassName('navigation-list-item--badgeCount-minimized'); | ||
9 | } | ||
10 | |||
11 | if (span.length > 0) { | ||
12 | count = parseInt(span[0].innerText, 10) | ||
13 | } | ||
14 | |||
15 | if (Number.isNaN(count)) { | ||
16 | count = 0; | ||
17 | } | ||
18 | |||
19 | Franz.setBadge(count); | ||
20 | }; | ||
21 | Franz.loop(getMessages); | ||
22 | }; \ No newline at end of file | ||