diff options
author | 2023-03-12 01:15:31 +0100 | |
---|---|---|
committer | 2023-03-12 00:15:31 +0000 | |
commit | 646bacbe276a1385033872ee9e1dff299fb92e2c (patch) | |
tree | 951d6e847a65b6f8091b53c09269ac0afd909b78 /recipes/hangouts/webview.js | |
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/hangouts/webview.js')
-rw-r--r-- | recipes/hangouts/webview.js | 3 |
1 files changed, 2 insertions, 1 deletions
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); |