diff options
author | 2023-05-03 02:08:48 +0300 | |
---|---|---|
committer | 2023-05-03 00:08:48 +0100 | |
commit | dc13a0b202d3d16e640b860e4cb62222d512e30b (patch) | |
tree | 97cd8e1f6553c15677cb888ee08e7bc0b8c797dd /recipes/yandex-mail | |
parent | Fix Google Classroom landing page (#346) (diff) | |
download | ferdium-recipes-dc13a0b202d3d16e640b860e4cb62222d512e30b.tar.gz ferdium-recipes-dc13a0b202d3d16e640b860e4cb62222d512e30b.tar.zst ferdium-recipes-dc13a0b202d3d16e640b860e4cb62222d512e30b.zip |
Update unread count for yandex-mail (#342)
Diffstat (limited to 'recipes/yandex-mail')
-rw-r--r-- | recipes/yandex-mail/package.json | 2 | ||||
-rw-r--r-- | recipes/yandex-mail/webview.js | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/recipes/yandex-mail/package.json b/recipes/yandex-mail/package.json index f2f4df3..88cb4e6 100644 --- a/recipes/yandex-mail/package.json +++ b/recipes/yandex-mail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "yandex-mail", | 2 | "id": "yandex-mail", |
3 | "name": "Yandex Mail", | 3 | "name": "Yandex Mail", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.yandex.ru" | 7 | "serviceURL": "https://mail.yandex.ru" |
diff --git a/recipes/yandex-mail/webview.js b/recipes/yandex-mail/webview.js index 66b82a7..b5a5156 100644 --- a/recipes/yandex-mail/webview.js +++ b/recipes/yandex-mail/webview.js | |||
@@ -1,10 +1,7 @@ | |||
1 | module.exports = Ferdium => { | 1 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let count = 0; | 3 | const button = document.querySelectorAll('[href="#unread"]')[0] ?? {}; |
4 | 4 | const count = Ferdium.safeParseInt(button.textContent); | |
5 | if (document.querySelectorAll('.mail-LabelList-Item_count').length > 1) { | ||
6 | count = Ferdium.safeParseInt(document.querySelectorAll('.mail-LabelList-Item_count')[1].textContent); | ||
7 | } | ||
8 | 5 | ||
9 | Ferdium.setBadge(count); | 6 | Ferdium.setBadge(count); |
10 | }; | 7 | }; |