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 | |
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')
-rwxr-xr-x | recipes/facebook/package.json | 2 | ||||
-rwxr-xr-x | 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 @@ | |||
1 | { | 1 | { |
2 | "id": "facebook", | 2 | "id": "facebook", |
3 | "name": "Facebook", | 3 | "name": "Facebook", |
4 | "version": "1.2.0", | 4 | "version": "1.2.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.facebook.com/login" | 7 | "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 => { | |||
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); |