aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--recipes/gmail/package.json2
-rw-r--r--recipes/gmail/webview.js9
2 files changed, 7 insertions, 4 deletions
diff --git a/recipes/gmail/package.json b/recipes/gmail/package.json
index 02aa3ab..2fd48d9 100644
--- a/recipes/gmail/package.json
+++ b/recipes/gmail/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "gmail", 2 "id": "gmail",
3 "name": "Gmail", 3 "name": "Gmail",
4 "version": "1.3.4", 4 "version": "1.3.5",
5 "description": "Gmail", 5 "description": "Gmail",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Stefan Malzner <stefan@adlk.io>", 7 "author": "Stefan Malzner <stefan@adlk.io>",
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