aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/vk
diff options
context:
space:
mode:
authorLibravatar Iaroslav <yavoloh@mail.ru>2021-10-26 07:59:12 +0500
committerLibravatar GitHub <noreply@github.com>2021-10-26 08:29:12 +0530
commit87731bd4a54dc3c40e0188d790d0f430cacf1ef6 (patch)
tree7b88a8d187ae1ff27651792aea447c3b523d518f /recipes/vk
parentchore: upgrade 'pnpm' to '6.19.0' (diff)
downloadferdium-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')
-rw-r--r--recipes/vk/package.json2
-rw-r--r--recipes/vk/webview.js18
2 files changed, 18 insertions, 2 deletions
diff --git a/recipes/vk/package.json b/recipes/vk/package.json
index e4b7dfa..e61c166 100644
--- a/recipes/vk/package.json
+++ b/recipes/vk/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "vk", 2 "id": "vk",
3 "name": "VK", 3 "name": "VK",
4 "version": "1.1.2", 4 "version": "1.1.3",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/meetfranz/recipe-vk", 6 "repository": "https://github.com/meetfranz/recipe-vk",
7 "config": { 7 "config": {
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};