diff options
author | Iaroslav <yavoloh@mail.ru> | 2021-10-26 07:59:12 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 08:29:12 +0530 |
commit | 87731bd4a54dc3c40e0188d790d0f430cacf1ef6 (patch) | |
tree | 7b88a8d187ae1ff27651792aea447c3b523d518f /recipes/facebook/webview.js | |
parent | chore: upgrade 'pnpm' to '6.19.0' (diff) | |
download | ferdium-recipes-87731bd4a54dc3c40e0188d790d0f430cacf1ef6.tar.gz ferdium-recipes-87731bd4a54dc3c40e0188d790d0f430cacf1ef6.tar.zst ferdium-recipes-87731bd4a54dc3c40e0188d790d0f430cacf1ef6.zip |
Add dialog title for VK, FB and Slack (#753)
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 | }; |