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/instagram/webview.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 recipes/instagram/webview.js (limited to 'recipes/instagram/webview.js') diff --git a/recipes/instagram/webview.js b/recipes/instagram/webview.js new file mode 100644 index 0000000..f4f7f94 --- /dev/null +++ b/recipes/instagram/webview.js @@ -0,0 +1,15 @@ +const path = require("path"); + +module.exports = (Franz) => { + const getMessages = function getMessages() { + const element = document.querySelector('a[href^="/direct/inbox"]'); + + if (element) { + Franz.setBadge(parseInt(element.innerText, 10)); + } + }; + + Franz.loop(getMessages); + + Franz.injectCSS(path.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-54-g00ecf