aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/producthunt/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/producthunt/webview.js')
-rw-r--r--recipes/producthunt/webview.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/recipes/producthunt/webview.js b/recipes/producthunt/webview.js
index c03de9b..7f6c74b 100644
--- a/recipes/producthunt/webview.js
+++ b/recipes/producthunt/webview.js
@@ -1,7 +1,13 @@
1module.exports = (Ferdi) => { 1module.exports = Ferdi => {
2 const notificationsSelector = document.querySelector(
3 '[class*=header_] [class*=content_] [class*=actions_] [class*=notificationsButton_]',
4 );
5
2 const getMessages = () => { 6 const getMessages = () => {
3 Ferdi.setBadge(document.querySelector('[class*=header_] [class*=content_] [class*=actions_] [class*=notificationsButton_]').innerText) 7 if (notificationsSelector) {
4 } 8 Ferdi.setBadge(notificationsSelector.textContent);
9 }
10 };
5 11
6 Ferdi.loop(getMessages) 12 Ferdi.loop(getMessages);
7} 13};