From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/evernote/webview.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 recipes/evernote/webview.js (limited to 'recipes/evernote/webview.js') diff --git a/recipes/evernote/webview.js b/recipes/evernote/webview.js new file mode 100644 index 0000000..60742ca --- /dev/null +++ b/recipes/evernote/webview.js @@ -0,0 +1,18 @@ +const path = require('path'); + +module.exports = (Franz, options) => { + const getMessages = () => { + const inbox = document.querySelector('.topbar-notificationsButton.has-newNotifications'); + const passiveCount = inbox === null ? 0 : 1; + // set Franz badge + // updates => active unread count + // inbox => passive unread count + Franz.setBadge(0, passiveCount); + }; + + // inject franz.css stylesheet + Franz.injectCSS(path.join(__dirname, 'css', 'franz.css')); + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2