diff options
author | Jake Lee <github@jakelee.co.uk> | 2020-05-05 08:01:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 07:01:34 +0000 |
commit | 943deca4887f52ec73b8a05663947dd11a354d9b (patch) | |
tree | 7f6ef0db6cb3a29e1ac79ab5f8e4b7e9bc4c0ee2 /uncompressed/guilded/webview.js | |
parent | Merge pull request #151 from SanketDG/sanketdg/update-featured (diff) | |
download | ferdium-recipes-943deca4887f52ec73b8a05663947dd11a354d9b.tar.gz ferdium-recipes-943deca4887f52ec73b8a05663947dd11a354d9b.tar.zst ferdium-recipes-943deca4887f52ec73b8a05663947dd11a354d9b.zip |
Adds Guilded.gg recipe (#150)
Diffstat (limited to 'uncompressed/guilded/webview.js')
-rw-r--r-- | uncompressed/guilded/webview.js | 15 |
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 | |||
3 | module.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 | ||