aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/mailfence/webview.js
diff options
context:
space:
mode:
authorLibravatar Abdul Hafiz Muhammad <109435420+hafiz-muhammad@users.noreply.github.com>2022-08-26 23:09:00 -0400
committerLibravatar GitHub <noreply@github.com>2022-08-27 03:09:00 +0000
commit8735813856440acb982db4fb1303e44a443c4298 (patch)
tree4c2c3ef1380849ee82951d4c8093cb92b3d843db /recipes/mailfence/webview.js
parentfix: add warning to whatsapp theming (#138) (diff)
downloadferdium-recipes-8735813856440acb982db4fb1303e44a443c4298.tar.gz
ferdium-recipes-8735813856440acb982db4fb1303e44a443c4298.tar.zst
ferdium-recipes-8735813856440acb982db4fb1303e44a443c4298.zip
Added Mailfence recipe. (#160)
Diffstat (limited to 'recipes/mailfence/webview.js')
-rw-r--r--recipes/mailfence/webview.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/recipes/mailfence/webview.js b/recipes/mailfence/webview.js
new file mode 100644
index 0000000..309f4e8
--- /dev/null
+++ b/recipes/mailfence/webview.js
@@ -0,0 +1,27 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj)
4{
5 return obj && obj.__esModule ? obj :
6 {
7 default: obj
8 };
9}
10
11module.exports = Ferdium =>
12{
13 const getMessages = () =>
14 {
15 let unreadCount = 0;
16 for (const counterElement of document.querySelectorAll('.GCSDBRWBMXB'))
17 {
18 const unreadCounter = Ferdium.safeParseInt(counterElement.textContent);
19 unreadCount = Math.max(unreadCount, unreadCounter);
20 }
21
22 Ferdium.setBadge(unreadCount);
23 };
24 Ferdium.loop(getMessages);
25
26 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
27}; \ No newline at end of file