diff options
Diffstat (limited to 'recipes/gmail/webview.js')
-rw-r--r-- | recipes/gmail/webview.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/recipes/gmail/webview.js b/recipes/gmail/webview.js index bc6e4a0..a2c712e 100644 --- a/recipes/gmail/webview.js +++ b/recipes/gmail/webview.js | |||
@@ -9,9 +9,12 @@ module.exports = (Franz) => { | |||
9 | const getMessages = function getMessages() { | 9 | const getMessages = function getMessages() { |
10 | let count = 0; | 10 | let count = 0; |
11 | 11 | ||
12 | if (document.getElementsByClassName('bsU').length > 0) { | 12 | const inboxLinks = document.getElementsByClassName('J-Ke n0'); |
13 | if (document.getElementsByClassName('bsU')[0].innerHTML != null) { | 13 | if (inboxLinks.length > 0) { |
14 | count = parseInt(document.getElementsByClassName('bsU')[0].innerHTML.trim(), 10); | 14 | const inboxLink = inboxLinks[0]; |
15 | const unreadCounts = inboxLink.parentNode.parentNode.getElementsByClassName('bsU'); | ||
16 | if (unreadCounts.length > 0) { | ||
17 | count = parseInt(unreadCounts[0].innerHTML.trim(), 10); | ||
15 | } | 18 | } |
16 | } | 19 | } |
17 | 20 | ||