diff options
author | 2023-11-26 02:34:38 +0100 | |
---|---|---|
committer | 2023-11-26 07:04:38 +0530 | |
commit | 681f58e3beea4e639a9f22ba101af427d7a76370 (patch) | |
tree | 084ae00b50268d1ef58abee567fd30abd96e39eb /recipes/instagram-direct-messages/webview.js | |
parent | Add recipe for Online Go (OGS) (#467) (diff) | |
download | ferdium-recipes-681f58e3beea4e639a9f22ba101af427d7a76370.tar.gz ferdium-recipes-681f58e3beea4e639a9f22ba101af427d7a76370.tar.zst ferdium-recipes-681f58e3beea4e639a9f22ba101af427d7a76370.zip |
fix badge for Instagram (#468)
Diffstat (limited to 'recipes/instagram-direct-messages/webview.js')
-rw-r--r-- | recipes/instagram-direct-messages/webview.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js index 01187b8..eb33ed1 100644 --- a/recipes/instagram-direct-messages/webview.js +++ b/recipes/instagram-direct-messages/webview.js | |||
@@ -12,9 +12,11 @@ setInterval(() => { | |||
12 | 12 | ||
13 | module.exports = Ferdium => { | 13 | module.exports = Ferdium => { |
14 | const getMessages = () => { | 14 | const getMessages = () => { |
15 | const element = document.querySelector('a[href^="/direct/inbox"]'); | 15 | const element = document.querySelector('a[href^="/direct/inbox"] span'); |
16 | Ferdium.setBadge( | 16 | Ferdium.setBadge( |
17 | element.textContent ? Ferdium.safeParseInt(element.textContent) : 0, | 17 | element && element.textContent |
18 | ? Ferdium.safeParseInt(element.textContent) | ||
19 | : 0, | ||
18 | ); | 20 | ); |
19 | }; | 21 | }; |
20 | 22 | ||