From 26862abea20a45d17850f064a5dc17fe8aef684e Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Mon, 11 Jul 2022 09:36:52 +0100 Subject: Fix facebook notifications counter (#118) Fix facebook badge counter --- recipes/facebook/package.json | 2 +- recipes/facebook/webview.js | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/recipes/facebook/package.json b/recipes/facebook/package.json index b76a2c7..238f422 100755 --- a/recipes/facebook/package.json +++ b/recipes/facebook/package.json @@ -1,7 +1,7 @@ { "id": "facebook", "name": "Facebook", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "config": { "serviceURL": "https://www.facebook.com/login" diff --git a/recipes/facebook/webview.js b/recipes/facebook/webview.js index d9e8687..1ff8558 100755 --- a/recipes/facebook/webview.js +++ b/recipes/facebook/webview.js @@ -2,19 +2,9 @@ module.exports = Ferdium => { const getNotifications = function getNotifications() { let count = 0; - const elements = [ - document.querySelector('#requestsCountValue'), - // document.getElementById('mercurymessagesCountValue'), - document.querySelector('#notificationsCountValue'), - document.querySelector( - '.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn', - ), - ]; - - for (const element of elements) { - if (element !== null) { - count += Ferdium.safeParseInt(element.textContent); - } + const queryList = document.querySelectorAll('.bp9cbjyn.bwm1u5wc.pq6dq46d.datstx6m.taijpn5t.jb3vyjys.jxrgncrl.qt6c0cv9.qnrpqo6b.k4urcfbm'); + for (const element of queryList) { + count += Ferdium.safeParseInt(element.textContent); } Ferdium.setBadge(count); -- cgit v1.2.3-54-g00ecf