diff options
author | 2021-02-21 05:22:56 -0500 | |
---|---|---|
committer | 2021-02-21 11:22:56 +0100 | |
commit | 7fe2a15787de34da2950ed3629e560ab0d5a9e64 (patch) | |
tree | 35865a19575e077ee4aa8d362592953214250fee /recipes/canvas/webview.js | |
parent | Add recipe for Azure DevOps (#430) (diff) | |
download | ferdium-recipes-7fe2a15787de34da2950ed3629e560ab0d5a9e64.tar.gz ferdium-recipes-7fe2a15787de34da2950ed3629e560ab0d5a9e64.tar.zst ferdium-recipes-7fe2a15787de34da2950ed3629e560ab0d5a9e64.zip |
Add recipe for Canvas (#437)
Add recipe for Canvas
Diffstat (limited to 'recipes/canvas/webview.js')
-rw-r--r-- | recipes/canvas/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdi => { | ||
4 | const getMessages = () => { | ||
5 | var direct = 0; | ||
6 | |||
7 | const MessageElement = document.querySelector('[id=global_nav_conversations_link]'); | ||
8 | if (MessageElement) { | ||
9 | direct += MessageElement.innerHTML; | ||
10 | } | ||
11 | |||
12 | Ferdi.setBadge(direct); | ||
13 | }; | ||
14 | |||
15 | Ferdi.loop(getMessages); | ||
16 | |||
17 | }; \ No newline at end of file | ||