From 7fe2a15787de34da2950ed3629e560ab0d5a9e64 Mon Sep 17 00:00:00 2001 From: Sagir Mo <78988840+Sagir-mo@users.noreply.github.com> Date: Sun, 21 Feb 2021 05:22:56 -0500 Subject: Add recipe for Canvas (#437) Add recipe for Canvas --- recipes/canvas/webview.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 recipes/canvas/webview.js (limited to 'recipes/canvas/webview.js') diff --git a/recipes/canvas/webview.js b/recipes/canvas/webview.js new file mode 100644 index 0000000..59d37e3 --- /dev/null +++ b/recipes/canvas/webview.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = Ferdi => { + const getMessages = () => { + var direct = 0; + + const MessageElement = document.querySelector('[id=global_nav_conversations_link]'); + if (MessageElement) { + direct += MessageElement.innerHTML; + } + + Ferdi.setBadge(direct); + }; + + Ferdi.loop(getMessages); + +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2