diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/hangoutschat/package.json | 2 | ||||
-rw-r--r-- | recipes/hangoutschat/webview.js | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/recipes/hangoutschat/package.json b/recipes/hangoutschat/package.json index 9bc79f1..4c0b260 100644 --- a/recipes/hangoutschat/package.json +++ b/recipes/hangoutschat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hangoutschat", | 2 | "id": "hangoutschat", |
3 | "name": "Hangouts Chat", | 3 | "name": "Hangouts Chat", |
4 | "version": "1.8.1", | 4 | "version": "1.8.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "google-chat", | 7 | "google-chat", |
diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js index 7f2acf2..307a752 100644 --- a/recipes/hangoutschat/webview.js +++ b/recipes/hangoutschat/webview.js | |||
@@ -14,9 +14,6 @@ module.exports = Ferdium => { | |||
14 | 'https://accounts.google.com/AccountChooser?continue=https://chat.google.com/?referrer=2'; | 14 | 'https://accounts.google.com/AccountChooser?continue=https://chat.google.com/?referrer=2'; |
15 | } | 15 | } |
16 | 16 | ||
17 | // class corresponding to the red badge that is visible for direct messages | ||
18 | const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; | ||
19 | |||
20 | // class corresponding to the bold text that is visible for room messages | 17 | // class corresponding to the bold text that is visible for room messages |
21 | const indirectMessageSelector = 'div.V6.CL.V2.X9.Y2 span.akt span.XU'; | 18 | const indirectMessageSelector = 'div.V6.CL.V2.X9.Y2 span.akt span.XU'; |
22 | 19 | ||
@@ -25,10 +22,8 @@ module.exports = Ferdium => { | |||
25 | let directCount; | 22 | let directCount; |
26 | let indirectCount; | 23 | let indirectCount; |
27 | 24 | ||
28 | const directCountSelector = document.querySelector(directMessageSelector); | 25 | // get unread messages count |
29 | if (directCountSelector) { | 26 | directCount = document.querySelectorAll('link[href^="https://ssl.gstatic.com/ui/v1/icons/mail/images/favicon_chat_new_notif_"][href$=".ico"]').length; |
30 | directCount = Number(directCountSelector.textContent); | ||
31 | } | ||
32 | 27 | ||
33 | // get unread indirect messages | 28 | // get unread indirect messages |
34 | const indirectCountSelector = document.querySelector( | 29 | const indirectCountSelector = document.querySelector( |