aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/facebook/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/facebook/webview.js')
-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 };