aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/guilded/webview.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2020-05-10 10:41:58 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2020-05-10 10:41:58 +0200
commitd927902163200b9ab30f27a9d7919abf0811c727 (patch)
tree237c8b657811d30f014aca8b414319d5eef17e74 /uncompressed/guilded/webview.js
parentAdd create script (diff)
parentMerge pull request #153 from dnlnrs/master (diff)
downloadferdium-recipes-d927902163200b9ab30f27a9d7919abf0811c727.tar.gz
ferdium-recipes-d927902163200b9ab30f27a9d7919abf0811c727.tar.zst
ferdium-recipes-d927902163200b9ab30f27a9d7919abf0811c727.zip
Merge branch 'master' of https://github.com/getferdi/recipes
Diffstat (limited to 'uncompressed/guilded/webview.js')
-rw-r--r--uncompressed/guilded/webview.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/uncompressed/guilded/webview.js b/uncompressed/guilded/webview.js
new file mode 100644
index 0000000..371fac8
--- /dev/null
+++ b/uncompressed/guilded/webview.js
@@ -0,0 +1,15 @@
1"use strict";
2
3module.exports = Franz => {
4 const getMessages = function getMessages() {
5 var unread = 0
6 const notificationBadge = document.getElementsByClassName('NavSelectorItem-unread-badge')[0]
7 if (notificationBadge != undefined) {
8 const innerBadge = notificationBadge.getElementsByClassName('BadgeV2-count')[0]
9 unread = innerBadge.innerText;
10 }
11 Franz.setBadge(parseInt(unread, 10));
12 };
13
14 Franz.loop(getMessages);
15}; \ No newline at end of file