diff options
author | Jonathan Weber <bejonwe@gmail.com> | 2021-12-23 17:00:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-23 17:00:32 +0100 |
commit | 2b0ddd3516b0c329087707bebeaa2bea50f5f724 (patch) | |
tree | 967c747eae4abccf63eef1446f4dbb60a4c78c98 /recipes/zoho/webview-unsafe.js | |
parent | Remove duplicate reference to node version for ease of maintenance (diff) | |
download | ferdium-recipes-2b0ddd3516b0c329087707bebeaa2bea50f5f724.tar.gz ferdium-recipes-2b0ddd3516b0c329087707bebeaa2bea50f5f724.tar.zst ferdium-recipes-2b0ddd3516b0c329087707bebeaa2bea50f5f724.zip |
Use the Zoho Mail JS API instead of outdated HTML elements (#791)
Diffstat (limited to 'recipes/zoho/webview-unsafe.js')
-rw-r--r-- | recipes/zoho/webview-unsafe.js | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ | |||
1 | //wait for Ferdi and Zoho Mail to initialize | ||
2 | if ( | ||
3 | Object.prototype.hasOwnProperty.call(window, "ferdi") && | ||
4 | Object.prototype.hasOwnProperty.call(window.ferdi, "setBadge") && | ||
5 | Object.prototype.hasOwnProperty.call(window, "zmNCenter") && | ||
6 | Object.prototype.hasOwnProperty.call(window, "zmfolAction") | ||
7 | ) { | ||
8 | var unreadNotifications = window.zmNCenter.counter.count(); //General Notifications by Zoho (Bell Icon) | ||
9 | var unreadMail = window.zmfolAction.getUnreadViewCount(); //Unread messages count | ||
10 | |||
11 | window.ferdi.setBadge(unreadMail, unreadNotifications); | ||
12 | } \ No newline at end of file | ||