diff options
Diffstat (limited to 'recipes/hangoutschat/webview.js')
-rw-r--r-- | recipes/hangoutschat/webview.js | 9 |
1 files changed, 2 insertions, 7 deletions
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( |