diff options
author | Abdul Hafiz Muhammad <109435420+hafiz-muhammad@users.noreply.github.com> | 2022-08-28 21:47:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 01:47:24 +0000 |
commit | 5434536ef4fa63174be3e4af5bf33d3ebe1872b2 (patch) | |
tree | ba20a5d3cf0855f97d32ed4b580ab854b1c4f654 /recipes/odysee/webview.js | |
parent | docs: add adameverson as a contributor for code (#162) [skip ci] (diff) | |
download | ferdium-recipes-5434536ef4fa63174be3e4af5bf33d3ebe1872b2.tar.gz ferdium-recipes-5434536ef4fa63174be3e4af5bf33d3ebe1872b2.tar.zst ferdium-recipes-5434536ef4fa63174be3e4af5bf33d3ebe1872b2.zip |
New recipe: Odysee (#165)
Diffstat (limited to 'recipes/odysee/webview.js')
-rw-r--r-- | recipes/odysee/webview.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/recipes/odysee/webview.js b/recipes/odysee/webview.js new file mode 100644 index 0000000..745e807 --- /dev/null +++ b/recipes/odysee/webview.js | |||
@@ -0,0 +1,15 @@ | |||
1 | module.exports = (Ferdium) => { | ||
2 | function getNotifications() { | ||
3 | let unreadNotifications = 0; | ||
4 | for (const notificationCounterElement of document.querySelectorAll( | ||
5 | ".notification__count" | ||
6 | )) { | ||
7 | unreadNotifications = | ||
8 | unreadNotifications + | ||
9 | Ferdium.safeParseInt(notificationCounterElement.textContent); | ||
10 | } | ||
11 | |||
12 | Ferdium.setBadge(unreadNotifications); | ||
13 | } | ||
14 | Ferdium.loop(getNotifications); | ||
15 | }; | ||