From 2b0ddd3516b0c329087707bebeaa2bea50f5f724 Mon Sep 17 00:00:00 2001 From: Jonathan Weber Date: Thu, 23 Dec 2021 17:00:32 +0100 Subject: Use the Zoho Mail JS API instead of outdated HTML elements (#791) --- recipes/zoho/webview-unsafe.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 recipes/zoho/webview-unsafe.js (limited to 'recipes/zoho/webview-unsafe.js') diff --git a/recipes/zoho/webview-unsafe.js b/recipes/zoho/webview-unsafe.js new file mode 100644 index 0000000..e4026c5 --- /dev/null +++ b/recipes/zoho/webview-unsafe.js @@ -0,0 +1,12 @@ +//wait for Ferdi and Zoho Mail to initialize +if ( + Object.prototype.hasOwnProperty.call(window, "ferdi") && + Object.prototype.hasOwnProperty.call(window.ferdi, "setBadge") && + Object.prototype.hasOwnProperty.call(window, "zmNCenter") && + Object.prototype.hasOwnProperty.call(window, "zmfolAction") +) { + var unreadNotifications = window.zmNCenter.counter.count(); //General Notifications by Zoho (Bell Icon) + var unreadMail = window.zmfolAction.getUnreadViewCount(); //Unread messages count + + window.ferdi.setBadge(unreadMail, unreadNotifications); +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf