aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gmail/webview.js
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-10-03 12:33:50 +0200
committerLibravatar GitHub <noreply@github.com>2020-10-03 12:33:50 +0200
commit0d9ca8fe7a47325adc975e3ff42906da13f8ed09 (patch)
tree35131a0d8ce7094a4810fbd767ee401a9688bd89 /recipes/gmail/webview.js
parentMerge pull request #308 from kris7t/skype-calls (diff)
parentMore careful Gmail unread count detection (diff)
downloadferdium-recipes-0d9ca8fe7a47325adc975e3ff42906da13f8ed09.tar.gz
ferdium-recipes-0d9ca8fe7a47325adc975e3ff42906da13f8ed09.tar.zst
ferdium-recipes-0d9ca8fe7a47325adc975e3ff42906da13f8ed09.zip
Merge pull request #307 from kris7t/gmail-unread-count
More careful Gmail unread count detection
Diffstat (limited to 'recipes/gmail/webview.js')
-rw-r--r--recipes/gmail/webview.js9
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