diff options
Diffstat (limited to 'uncompressed/msteams/webview.js')
-rw-r--r-- | uncompressed/msteams/webview.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/uncompressed/msteams/webview.js b/uncompressed/msteams/webview.js new file mode 100644 index 0000000..d614097 --- /dev/null +++ b/uncompressed/msteams/webview.js | |||
@@ -0,0 +1,29 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const path = require('path'); | ||
4 | |||
5 | window.electronSafeIpc = { | ||
6 | send: () => null, | ||
7 | on: () => null | ||
8 | }; | ||
9 | window.desktop = undefined; | ||
10 | |||
11 | module.exports = Franz => { | ||
12 | const getMessages = () => { | ||
13 | let messages = 0; | ||
14 | const badge = document.querySelector('.activity-badge.dot-activity-badge .activity-badge'); | ||
15 | |||
16 | if (badge) { | ||
17 | const value = parseInt(badge.innerHTML, 10); | ||
18 | |||
19 | if (!isNaN(value)) { | ||
20 | messages = value; | ||
21 | } | ||
22 | } | ||
23 | |||
24 | Franz.setBadge(messages); | ||
25 | }; | ||
26 | |||
27 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
28 | Franz.loop(getMessages); | ||
29 | }; \ No newline at end of file | ||