aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/odysee/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/odysee/webview.js')
-rw-r--r--recipes/odysee/webview.js15
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 @@
1module.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};