diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-07-11 09:36:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 09:36:52 +0100 |
commit | 26862abea20a45d17850f064a5dc17fe8aef684e (patch) | |
tree | 6eb7c3ac295604b34bab79840c84cb6a12be78a8 /recipes/facebook/webview.js | |
parent | Fix issue with telegram web-k not being recognized correctly (diff) | |
download | ferdium-recipes-26862abea20a45d17850f064a5dc17fe8aef684e.tar.gz ferdium-recipes-26862abea20a45d17850f064a5dc17fe8aef684e.tar.zst ferdium-recipes-26862abea20a45d17850f064a5dc17fe8aef684e.zip |
Fix facebook notifications counter (#118)
Fix facebook badge counter
Diffstat (limited to 'recipes/facebook/webview.js')
-rwxr-xr-x | recipes/facebook/webview.js | 16 |
1 files changed, 3 insertions, 13 deletions
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 => { | |||
2 | const getNotifications = function getNotifications() { | 2 | const getNotifications = function getNotifications() { |
3 | let count = 0; | 3 | let count = 0; |
4 | 4 | ||
5 | const elements = [ | 5 | const queryList = document.querySelectorAll('.bp9cbjyn.bwm1u5wc.pq6dq46d.datstx6m.taijpn5t.jb3vyjys.jxrgncrl.qt6c0cv9.qnrpqo6b.k4urcfbm'); |
6 | document.querySelector('#requestsCountValue'), | 6 | for (const element of queryList) { |
7 | // document.getElementById('mercurymessagesCountValue'), | 7 | count += Ferdium.safeParseInt(element.textContent); |
8 | document.querySelector('#notificationsCountValue'), | ||
9 | document.querySelector( | ||
10 | '.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn', | ||
11 | ), | ||
12 | ]; | ||
13 | |||
14 | for (const element of elements) { | ||
15 | if (element !== null) { | ||
16 | count += Ferdium.safeParseInt(element.textContent); | ||
17 | } | ||
18 | } | 8 | } |
19 | 9 | ||
20 | Ferdium.setBadge(count); | 10 | Ferdium.setBadge(count); |