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/vk/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/vk/webview.js')
-rw-r--r-- | recipes/vk/webview.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/recipes/vk/webview.js b/recipes/vk/webview.js index decec13..6756363 100644 --- a/recipes/vk/webview.js +++ b/recipes/vk/webview.js | |||
@@ -9,5 +9,21 @@ module.exports = Ferdi => { | |||
9 | Ferdi.setBadge(directs); | 9 | Ferdi.setBadge(directs); |
10 | }; | 10 | }; |
11 | 11 | ||
12 | Ferdi.loop(getMessages); | 12 | const getActiveDialogTitle = () => { |
13 | const element = [ | ||
14 | document.querySelector( | ||
15 | '.FCWindow--active .FCWindow__title .ConvoTitle__title', | ||
16 | ), | ||
17 | document.querySelector('.im-page_history-show ._im_page_peer_name'), | ||
18 | ].find(Boolean); | ||
19 | |||
20 | Ferdi.setDialogTitle(element ? element.textContent : null); | ||
21 | }; | ||
22 | |||
23 | const loopFunc = () => { | ||
24 | getMessages(); | ||
25 | getActiveDialogTitle(); | ||
26 | }; | ||
27 | |||
28 | Ferdi.loop(loopFunc); | ||
13 | }; | 29 | }; |