diff options
Diffstat (limited to 'recipes/facebook')
-rwxr-xr-x | recipes/facebook/package.json | 2 | ||||
-rwxr-xr-x | recipes/facebook/webview.js | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/recipes/facebook/package.json b/recipes/facebook/package.json index 2f5a54a..53bc486 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.1.1", | 4 | "version": "1.1.2", |
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 b38a2fb..3100935 100755 --- a/recipes/facebook/webview.js +++ b/recipes/facebook/webview.js | |||
@@ -20,5 +20,23 @@ module.exports = Ferdi => { | |||
20 | Ferdi.setBadge(count); | 20 | Ferdi.setBadge(count); |
21 | }; | 21 | }; |
22 | 22 | ||
23 | Ferdi.loop(getNotifications); | 23 | const getActiveDialogTitle = () => { |
24 | const element = [ | ||
25 | document.querySelector( | ||
26 | '.cbu4d94t:not(.kr9hpln1) .l9j0dhe7 .pfnyh3mw .g5gj957u .ni8dbmo4.stjgntxs.g0qnabr5.ltmttdrg.ekzkrbhg.mdldhsdk.oo9gr5id', | ||
27 | ), | ||
28 | document.querySelector( | ||
29 | '.j83agx80.cbu4d94t.d6urw2fd.dp1hu0rb.l9j0dhe7.du4w35lb:not(.kr9hpln1) .rq0escxv[role="main"] .t6p9ggj4.tkr6xdv7 .d2edcug0.j83agx80.bp9cbjyn.aahdfvyu.bi6gxh9e .a8c37x1j.ni8dbmo4.stjgntxs.l9j0dhe7.ltmttdrg.g0qnabr5.ojkyduve a.lzcic4wl.gmql0nx0.gpro0wi8.lrazzd5p', | ||
30 | ), | ||
31 | ].find(Boolean); | ||
32 | |||
33 | Ferdi.setDialogTitle(element ? element.textContent : null); | ||
34 | }; | ||
35 | |||
36 | const loopFunc = () => { | ||
37 | getNotifications(); | ||
38 | getActiveDialogTitle(); | ||
39 | }; | ||
40 | |||
41 | Ferdi.loop(loopFunc); | ||
24 | }; | 42 | }; |