From fe47c792691e4fffbeae4a59b638eee0468a4d83 Mon Sep 17 00:00:00 2001 From: Slan Date: Wed, 13 Jul 2022 12:41:18 +0100 Subject: Error Handling on Office 365 landing page (#125) Updated Office365 trying to fetch xpath elements that dont exist yet --- recipes/office365-owa/webview.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'recipes/office365-owa/webview.js') 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) => { const getMessages = () => { let directUnreadCount = 0; let indirectUnreadCount = 0; - if (/\/owa/.test(location.pathname)) { // classic app directUnreadCount = Ferdium.safeParseInt( - document.querySelectorAll("span[title*='Inbox'] + div > span")[0] - .textContent, + document.querySelectorAll("span[title*='Inbox'] + div > span")[0]?.textContent ); } else { // new app @@ -37,6 +35,5 @@ module.exports = (Ferdium, settings) => { Ferdium.setBadge(directUnreadCount, indirectUnreadCount); }; - Ferdium.loop(getMessages); }; -- cgit v1.2.3-70-g09d2