From 646bacbe276a1385033872ee9e1dff299fb92e2c Mon Sep 17 00:00:00 2001 From: tamas646 Date: Sun, 12 Mar 2023 01:15:31 +0100 Subject: Fix Hangouts badge counter (#324) --- recipes/hangouts/package.json | 2 +- recipes/hangouts/webview.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'recipes/hangouts') 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 @@ { "id": "hangouts", "name": "Hangouts", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "config": { "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 @@ module.exports = Ferdium => { const getMessages = () => { // get unread messages - const count = document.querySelector('#hangout-landing-chat iframe').contentWindow.document.querySelectorAll('.ee').length; + let count = 0; + for (const span of document.querySelectorAll('span[jsname=DW2nlb]')) count += Ferdium.safeParseInt(span.textContent); // set Ferdium badge Ferdium.setBadge(count); -- cgit v1.2.3-70-g09d2