diff options
author | 2022-07-13 12:41:18 +0100 | |
---|---|---|
committer | 2022-07-13 12:41:18 +0100 | |
commit | fe47c792691e4fffbeae4a59b638eee0468a4d83 (patch) | |
tree | a5f39cb238e8afc795f38a0e8744835fbcf278c9 /recipes/office365-owa/webview.js | |
parent | Bump github recipe version that was missed in previous commit (diff) | |
download | ferdium-recipes-fe47c792691e4fffbeae4a59b638eee0468a4d83.tar.gz ferdium-recipes-fe47c792691e4fffbeae4a59b638eee0468a4d83.tar.zst ferdium-recipes-fe47c792691e4fffbeae4a59b638eee0468a4d83.zip |
Error Handling on Office 365 landing page (#125)
Updated Office365 trying to fetch xpath elements that dont exist yet
Diffstat (limited to 'recipes/office365-owa/webview.js')
-rw-r--r-- | recipes/office365-owa/webview.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js index 70790f0..9613636 100644 --- a/recipes/office365-owa/webview.js +++ b/recipes/office365-owa/webview.js | |||
@@ -18,12 +18,10 @@ module.exports = (Ferdium, settings) => { | |||
18 | const getMessages = () => { | 18 | const getMessages = () => { |
19 | let directUnreadCount = 0; | 19 | let directUnreadCount = 0; |
20 | let indirectUnreadCount = 0; | 20 | let indirectUnreadCount = 0; |
21 | |||
22 | if (/\/owa/.test(location.pathname)) { | 21 | if (/\/owa/.test(location.pathname)) { |
23 | // classic app | 22 | // classic app |
24 | directUnreadCount = Ferdium.safeParseInt( | 23 | directUnreadCount = Ferdium.safeParseInt( |
25 | document.querySelectorAll("span[title*='Inbox'] + div > span")[0] | 24 | document.querySelectorAll("span[title*='Inbox'] + div > span")[0]?.textContent |
26 | .textContent, | ||
27 | ); | 25 | ); |
28 | } else { | 26 | } else { |
29 | // new app | 27 | // new app |
@@ -37,6 +35,5 @@ module.exports = (Ferdium, settings) => { | |||
37 | 35 | ||
38 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); | 36 | Ferdium.setBadge(directUnreadCount, indirectUnreadCount); |
39 | }; | 37 | }; |
40 | |||
41 | Ferdium.loop(getMessages); | 38 | Ferdium.loop(getMessages); |
42 | }; | 39 | }; |