aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/twitter/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/twitter/webview.js')
-rw-r--r--recipes/twitter/webview.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/recipes/twitter/webview.js b/recipes/twitter/webview.js
index dfd06d1..d88e3e4 100644
--- a/recipes/twitter/webview.js
+++ b/recipes/twitter/webview.js
@@ -4,13 +4,17 @@ module.exports = Ferdi => {
4 4
5 // "Notifications" and "Messages" - aria-label ending in 5 // "Notifications" and "Messages" - aria-label ending in
6 // "unread items". Sum the values for direct badge. 6 // "unread items". Sum the values for direct badge.
7 const notificationsElement = document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div'); 7 const notificationsElement = document.querySelector(
8 '[data-testid=AppTabBar_Notifications_Link] div div div',
9 );
8 if (notificationsElement) { 10 if (notificationsElement) {
9 direct += Ferdi.safeParseInt(notificationsElement.innerHTML); 11 direct += Ferdi.safeParseInt(notificationsElement.textContent);
10 } 12 }
11 const DMElement = document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div'); 13 const DMElement = document.querySelector(
14 '[data-testid=AppTabBar_DirectMessage_Link] div div div',
15 );
12 if (DMElement) { 16 if (DMElement) {
13 direct += Ferdi.safeParseInt(DMElement.innerHTML); 17 direct += Ferdi.safeParseInt(DMElement.textContent);
14 } 18 }
15 19
16 Ferdi.setBadge(direct); 20 Ferdi.setBadge(direct);