From 4b3385094ba8a89247be421c81603a8dcbc99753 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 12 Sep 2021 13:08:33 +0530 Subject: New recipe: 'misskey' (#693) --- recipes/misskey/webview.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 recipes/misskey/webview.js (limited to 'recipes/misskey/webview.js') diff --git a/recipes/misskey/webview.js b/recipes/misskey/webview.js new file mode 100644 index 0000000..b024ce1 --- /dev/null +++ b/recipes/misskey/webview.js @@ -0,0 +1,9 @@ +module.exports = (Ferdi) => { + const getMessages = function getMessages() { + // check notification badge for Ferdi badge + let hasNotification = !!document.querySelector('#app div.notifications > button > i.circle'); + Ferdi.setBadge(0, hasNotification ? 1 : 0); + }; + + Ferdi.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2