aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/hackmd/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/hackmd/webview.js')
-rw-r--r--recipes/hackmd/webview.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes/hackmd/webview.js b/recipes/hackmd/webview.js
new file mode 100644
index 0000000..1977953
--- /dev/null
+++ b/recipes/hackmd/webview.js
@@ -0,0 +1,17 @@
1const path = require("path");
2
3module.exports = (Franz) => {
4 const getMessages = function getMessages() {
5 // get unread messages
6 const count = document.querySelectorAll('.guilds-wrapper .badge').length;
7
8 // set Franz badge
9 Franz.setBadge(count);
10 };
11
12 // check for new messages every second and update Franz badge
13 Franz.loop(getMessages);
14
15 // Hide download message
16 Franz.injectCSS(path.join(__dirname, 'service.css'));
17};