aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/facebook
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-05 17:04:09 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-05 17:04:09 +0200
commitd3841b766f9d37d557646003899f67525c5f755f (patch)
tree1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/facebook
parentchore: repo maintenance (#732) (diff)
downloadferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/facebook')
-rwxr-xr-xrecipes/facebook/webview.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/recipes/facebook/webview.js b/recipes/facebook/webview.js
index 43de149..b38a2fb 100755
--- a/recipes/facebook/webview.js
+++ b/recipes/facebook/webview.js
@@ -1,19 +1,21 @@
1module.exports = (Ferdi) => { 1module.exports = Ferdi => {
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 elements = [
6 document.getElementById('requestsCountValue'), 6 document.querySelector('#requestsCountValue'),
7 // document.getElementById('mercurymessagesCountValue'), 7 // document.getElementById('mercurymessagesCountValue'),
8 document.getElementById('notificationsCountValue'), 8 document.querySelector('#notificationsCountValue'),
9 document.querySelector('.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn'), 9 document.querySelector(
10 '.k4urcfbm.qnrpqo6b.qt6c0cv9.jxrgncrl.jb3vyjys.taijpn5t.datstx6m.pq6dq46d.ljqsnud1.bp9cbjyn',
11 ),
10 ]; 12 ];
11 13
12 elements.forEach((element) => { 14 for (const element of elements) {
13 if (element !== null) { 15 if (element !== null) {
14 count += Ferdi.safeParseInt(element.innerHTML); 16 count += Ferdi.safeParseInt(element.textContent);
15 } 17 }
16 }); 18 }
17 19
18 Ferdi.setBadge(count); 20 Ferdi.setBadge(count);
19 }; 21 };