diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/gmail/package.json | 2 | ||||
-rw-r--r-- | recipes/gmail/webview.js | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/recipes/gmail/package.json b/recipes/gmail/package.json index ffb7757..adaa88f 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.6.0", | 4 | "version": "1.6.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.google.com" | 7 | "serviceURL": "https://mail.google.com" |
diff --git a/recipes/gmail/webview.js b/recipes/gmail/webview.js index dead877..6db2eec 100644 --- a/recipes/gmail/webview.js +++ b/recipes/gmail/webview.js | |||
@@ -18,6 +18,8 @@ module.exports = Ferdium => { | |||
18 | let countImportant = 0; | 18 | let countImportant = 0; |
19 | let countNonImportant = 0; | 19 | let countNonImportant = 0; |
20 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); | 20 | const inboxLinks = document.querySelectorAll('.J-Ke.n0'); |
21 | const spaceAndChatBadges = document.querySelectorAll('span.XU.aH6'); | ||
22 | |||
21 | if (inboxLinks.length > 0) { | 23 | if (inboxLinks.length > 0) { |
22 | const { parentNode } = inboxLinks[0]; | 24 | const { parentNode } = inboxLinks[0]; |
23 | if (parentNode) { | 25 | if (parentNode) { |
@@ -41,6 +43,16 @@ module.exports = Ferdium => { | |||
41 | } | 43 | } |
42 | } | 44 | } |
43 | } | 45 | } |
46 | |||
47 | if (spaceAndChatBadges.length > 0) { | ||
48 | const arr = [...spaceAndChatBadges]; | ||
49 | const spaceAndChatCount = arr.reduce( | ||
50 | (acc, e) => Ferdium.safeParseInt(e.getInnerHTML()) + acc, | ||
51 | 0, | ||
52 | ); | ||
53 | countImportant += spaceAndChatCount; | ||
54 | } | ||
55 | |||
44 | Ferdium.setBadge(countImportant, countNonImportant); | 56 | Ferdium.setBadge(countImportant, countNonImportant); |
45 | }; | 57 | }; |
46 | 58 | ||