aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorLibravatar Shampra <16141040+Shampra@users.noreply.github.com>2024-05-24 12:37:59 +0200
committerLibravatar GitHub <noreply@github.com>2024-05-24 16:07:59 +0530
commit0ac12867ab678668de43c36113610b9381937009 (patch)
treef2fb651ac37dcd770298861fb7b32879c30a62f3 /recipes
parentadd Shampra as a contributor for code [skip ci] (#553) (diff)
downloadferdium-recipes-0ac12867ab678668de43c36113610b9381937009.tar.gz
ferdium-recipes-0ac12867ab678668de43c36113610b9381937009.tar.zst
ferdium-recipes-0ac12867ab678668de43c36113610b9381937009.zip
Fix the method for detecting unread messages for Google Chat (#554)
Diffstat (limited to 'recipes')
-rw-r--r--recipes/hangoutschat/package.json2
-rw-r--r--recipes/hangoutschat/webview.js9
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(