diff options
Diffstat (limited to 'recipes/facebook/webview.js')
-rwxr-xr-x | recipes/facebook/webview.js | 20 |
1 files changed, 19 insertions, 1 deletions
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 | }; |