aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/yandex-mail/webview.js
diff options
context:
space:
mode:
authorLibravatar Valerii Malov <jazzvoid@gmail.com>2023-05-03 02:08:48 +0300
committerLibravatar GitHub <noreply@github.com>2023-05-03 00:08:48 +0100
commitdc13a0b202d3d16e640b860e4cb62222d512e30b (patch)
tree97cd8e1f6553c15677cb888ee08e7bc0b8c797dd /recipes/yandex-mail/webview.js
parentFix Google Classroom landing page (#346) (diff)
downloadferdium-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/webview.js')
-rw-r--r--recipes/yandex-mail/webview.js7
1 files changed, 2 insertions, 5 deletions
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 @@
1module.exports = Ferdium => { 1module.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 };