diff options
author | tamas646 <ptamas2002@gmail.com> | 2023-03-12 01:15:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-12 00:15:31 +0000 |
commit | 646bacbe276a1385033872ee9e1dff299fb92e2c (patch) | |
tree | 951d6e847a65b6f8091b53c09269ac0afd909b78 /recipes | |
parent | New Recipe BlueBubbles (#316) (diff) | |
download | ferdium-recipes-646bacbe276a1385033872ee9e1dff299fb92e2c.tar.gz ferdium-recipes-646bacbe276a1385033872ee9e1dff299fb92e2c.tar.zst ferdium-recipes-646bacbe276a1385033872ee9e1dff299fb92e2c.zip |
Fix Hangouts badge counter (#324)
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/hangouts/package.json | 2 | ||||
-rw-r--r-- | recipes/hangouts/webview.js | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/recipes/hangouts/package.json b/recipes/hangouts/package.json index e14f05e..bb76e4b 100644 --- a/recipes/hangouts/package.json +++ b/recipes/hangouts/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hangouts", | 2 | "id": "hangouts", |
3 | "name": "Hangouts", | 3 | "name": "Hangouts", |
4 | "version": "1.3.0", | 4 | "version": "1.3.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://hangouts.google.com", | 7 | "serviceURL": "https://hangouts.google.com", |
diff --git a/recipes/hangouts/webview.js b/recipes/hangouts/webview.js index f57864e..02ded41 100644 --- a/recipes/hangouts/webview.js +++ b/recipes/hangouts/webview.js | |||
@@ -1,7 +1,8 @@ | |||
1 | module.exports = Ferdium => { | 1 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | // get unread messages | 3 | // get unread messages |
4 | const count = document.querySelector('#hangout-landing-chat iframe').contentWindow.document.querySelectorAll('.ee').length; | 4 | let count = 0; |
5 | for (const span of document.querySelectorAll('span[jsname=DW2nlb]')) count += Ferdium.safeParseInt(span.textContent); | ||
5 | 6 | ||
6 | // set Ferdium badge | 7 | // set Ferdium badge |
7 | Ferdium.setBadge(count); | 8 | Ferdium.setBadge(count); |