diff options
author | 2020-02-05 20:14:57 +0100 | |
---|---|---|
committer | 2020-02-05 20:14:57 +0100 | |
commit | f47c638a38baad7a978baf8e204743227f4005e2 (patch) | |
tree | 611a21246df5067dc660e6e8b9b559c607a96c5e /uncompressed/twitter/webview.js | |
parent | Add Twitter recipe (diff) | |
download | ferdium-recipes-f47c638a38baad7a978baf8e204743227f4005e2.tar.gz ferdium-recipes-f47c638a38baad7a978baf8e204743227f4005e2.tar.zst ferdium-recipes-f47c638a38baad7a978baf8e204743227f4005e2.zip |
Improve Twitter recipe
Diffstat (limited to 'uncompressed/twitter/webview.js')
-rw-r--r-- | uncompressed/twitter/webview.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/uncompressed/twitter/webview.js b/uncompressed/twitter/webview.js index 75655f1..81f0ba5 100644 --- a/uncompressed/twitter/webview.js +++ b/uncompressed/twitter/webview.js | |||
@@ -6,9 +6,15 @@ module.exports = Franz => { | |||
6 | 6 | ||
7 | // "Notifications" and "Messages" - aria-label ending in | 7 | // "Notifications" and "Messages" - aria-label ending in |
8 | // "unread items". Sum the values for direct badge. | 8 | // "unread items". Sum the values for direct badge. |
9 | direct += document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div').innerHTML; | 9 | const notificationsElement = document.querySelector('[data-testid=AppTabBar_Notifications_Link] div div div'); |
10 | direct += document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div').innerHTML; | 10 | if (notificationsElement) { |
11 | 11 | direct += notificationsElement.innerHTML; | |
12 | } | ||
13 | const DMElement = document.querySelector('[data-testid=AppTabBar_DirectMessage_Link] div div div'); | ||
14 | if (DMElement) { | ||
15 | direct += DMElement.innerHTML; | ||
16 | } | ||
17 | |||
12 | Franz.setBadge(direct); | 18 | Franz.setBadge(direct); |
13 | }; | 19 | }; |
14 | 20 | ||