diff options
author | 2022-05-10 20:57:19 +0200 | |
---|---|---|
committer | 2022-05-10 18:57:19 +0000 | |
commit | e8d87a2a9668b085167a55eb8ae2fd4c1df44c82 (patch) | |
tree | a5c8b4b4a9432f48b3d33def3807382bd44b0359 /recipes | |
parent | upgrade node js to latest LTS version and pnpm from 6.x to 7.x (#17) (diff) | |
download | ferdium-recipes-e8d87a2a9668b085167a55eb8ae2fd4c1df44c82.tar.gz ferdium-recipes-e8d87a2a9668b085167a55eb8ae2fd4c1df44c82.tar.zst ferdium-recipes-e8d87a2a9668b085167a55eb8ae2fd4c1df44c82.zip |
Telegram detection defaults to webZ if not webK (#19)
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/telegram/package.json | 2 | ||||
-rw-r--r-- | recipes/telegram/webview.js | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/recipes/telegram/package.json b/recipes/telegram/package.json index acc0a54..54843eb 100644 --- a/recipes/telegram/package.json +++ b/recipes/telegram/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "telegram", | 2 | "id": "telegram", |
3 | "name": "Telegram", | 3 | "name": "Telegram", |
4 | "version": "3.3.0", | 4 | "version": "3.3.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.telegram.org", | 7 | "serviceURL": "https://web.telegram.org", |
diff --git a/recipes/telegram/webview.js b/recipes/telegram/webview.js index f05b43f..632aff0 100644 --- a/recipes/telegram/webview.js +++ b/recipes/telegram/webview.js | |||
@@ -9,7 +9,6 @@ module.exports = Ferdium => { | |||
9 | .querySelector('meta[name="application-name"]') | 9 | .querySelector('meta[name="application-name"]') |
10 | ?.getAttribute('content'); | 10 | ?.getAttribute('content'); |
11 | 11 | ||
12 | const isWebZ = telegramVersion?.includes('WebZ'); | ||
13 | const isWebK = telegramVersion?.includes('WebK'); | 12 | const isWebK = telegramVersion?.includes('WebK'); |
14 | 13 | ||
15 | // There are two different Telegram versions for internal competition | 14 | // There are two different Telegram versions for internal competition |
@@ -60,20 +59,20 @@ module.exports = Ferdium => { | |||
60 | }; | 59 | }; |
61 | 60 | ||
62 | const getMessages = () => { | 61 | const getMessages = () => { |
63 | if (isWebZ) { | 62 | if (isWebK) { |
64 | webZCount(); | ||
65 | } else if (isWebK) { | ||
66 | webKCount(); | 63 | webKCount(); |
64 | } else { | ||
65 | webZCount(); | ||
67 | } | 66 | } |
68 | }; | 67 | }; |
69 | 68 | ||
70 | const getActiveDialogTitle = () => { | 69 | const getActiveDialogTitle = () => { |
71 | let element; | 70 | let element; |
72 | 71 | ||
73 | if (isWebZ) { | 72 | if (isWebK) { |
74 | element = document.querySelector('.chat-list .ListItem .title > h3'); | ||
75 | } else if (isWebK) { | ||
76 | element = document.querySelector('.top .peer-title'); | 73 | element = document.querySelector('.top .peer-title'); |
74 | } else { | ||
75 | element = document.querySelector('.chat-list .ListItem .title > h3'); | ||
77 | } | 76 | } |
78 | 77 | ||
79 | Ferdium.setDialogTitle(element ? element.textContent : ''); | 78 | Ferdium.setDialogTitle(element ? element.textContent : ''); |