aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/disqus/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/disqus/webview.js')
-rw-r--r--recipes/disqus/webview.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/recipes/disqus/webview.js b/recipes/disqus/webview.js
index a79f5e7..fcdd386 100644
--- a/recipes/disqus/webview.js
+++ b/recipes/disqus/webview.js
@@ -1,15 +1,14 @@
1module.exports = Ferdi => { 1module.exports = Ferdi => {
2 const getInnerInt = selector => { 2 const getInnerInt = selector => {
3 const element = document.querySelector(selector); 3 const element = document.querySelector(selector);
4 return element && Ferdi.safeParseInt(element.innerText); 4 return element && Ferdi.safeParseInt(element.textContent);
5 }; 5 };
6 6
7 const getMessages = () => { 7 const getMessages = () => {
8 const direct = ( 8 const direct =
9 getInnerInt("header div[data-role='unread-notification-count']") || 9 getInnerInt("header div[data-role='unread-notification-count']") ||
10 getInnerInt('a.has-notifs div.notif-count') || 10 getInnerInt('a.has-notifs div.notif-count') ||
11 0 11 0;
12 );
13 12
14 Ferdi.setBadge(direct); 13 Ferdi.setBadge(direct);
15 }; 14 };