diff options
author | 2022-09-18 13:01:57 +0200 | |
---|---|---|
committer | 2022-09-18 13:01:57 +0200 | |
commit | 39c3f63261a5befd9f2ed42b27bd5ebeb0b8559c (patch) | |
tree | e74920b47b9a0d074c4eb8a9e9b6d97082753844 /recipes | |
parent | add Bass-03 as a contributor (#176) [skip ci] (diff) | |
download | ferdium-recipes-39c3f63261a5befd9f2ed42b27bd5ebeb0b8559c.tar.gz ferdium-recipes-39c3f63261a5befd9f2ed42b27bd5ebeb0b8559c.tar.zst ferdium-recipes-39c3f63261a5befd9f2ed42b27bd5ebeb0b8559c.zip |
Updated Messenger's notification detection based on "white_rqbbit"'s findings on the server. Works fine in my local instance, but will need to be updated every time FB messes with the class names.
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/messenger/package.json | 2 | ||||
-rw-r--r-- | recipes/messenger/webview.js | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/recipes/messenger/package.json b/recipes/messenger/package.json index 293bca1..33d6001 100644 --- a/recipes/messenger/package.json +++ b/recipes/messenger/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "messenger", | 2 | "id": "messenger", |
3 | "name": "Messenger", | 3 | "name": "Messenger", |
4 | "version": "1.7.3", | 4 | "version": "1.7.4", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://messenger.com", | 7 | "serviceURL": "https://messenger.com", |
diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 3c8d2c0..ef9e324 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js | |||
@@ -7,14 +7,18 @@ function hideInstallMessage() { | |||
7 | 7 | ||
8 | module.exports = Ferdium => { | 8 | module.exports = Ferdium => { |
9 | const getMessages = () => { | 9 | const getMessages = () => { |
10 | let count = [...document.querySelectorAll('.bp9cbjyn.j83agx80.owycx6da:not(.btwxx1t3)')] | 10 | /*let count = [...document.querySelectorAll('.bp9cbjyn.j83agx80.owycx6da:not(.btwxx1t3)')] |
11 | .map(elem => { | 11 | .map(elem => { |
12 | const hasPing = !!elem.querySelector('.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa'); | 12 | const hasPing = !!elem.querySelector('.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa'); |
13 | const isMuted = !!elem.querySelector('.a8c37x1j.ms05siws.l3qrxjdp.b7h9ocf4.trssfv1o'); | 13 | const isMuted = !!elem.querySelector('.a8c37x1j.ms05siws.l3qrxjdp.b7h9ocf4.trssfv1o'); |
14 | 14 | ||
15 | return hasPing && !isMuted; | 15 | return hasPing && !isMuted; |
16 | }) | 16 | }) |
17 | .reduce((prev, curr) => prev + curr, 0); | 17 | .reduce((prev, curr) => prev + curr, 0);*/ |
18 | let count = 0; | ||
19 | document.querySelectorAll('[data-testid="mwthreadlist-item"]').forEach((node) => { | ||
20 | if (node.querySelector('.lrazzd5p, .is6700om, .o48pnaf2')) count += 1; | ||
21 | }); | ||
18 | 22 | ||
19 | /* | 23 | /* |
20 | * add count of message requests on top of notification counter | 24 | * add count of message requests on top of notification counter |