diff options
author | 2020-09-22 20:56:48 +0200 | |
---|---|---|
committer | 2020-09-22 19:56:48 +0100 | |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/fastmail/webview.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'recipes/fastmail/webview.js')
-rw-r--r-- | recipes/fastmail/webview.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/recipes/fastmail/webview.js b/recipes/fastmail/webview.js new file mode 100644 index 0000000..003d18c --- /dev/null +++ b/recipes/fastmail/webview.js | |||
@@ -0,0 +1,27 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | var interval = setInterval(function () { | ||
5 | if (!window.O || !window.O.WindowController) return; | ||
6 | window.O.WindowController.openExternal = function (href) { | ||
7 | var temp = document.createElement('a'); | ||
8 | temp.setAttribute('href', href); | ||
9 | temp.setAttribute('target', '_blank'); | ||
10 | temp.click(); | ||
11 | }; | ||
12 | clearInterval(interval); | ||
13 | }, 200); | ||
14 | const getMessages = () => { | ||
15 | const inbox = document.querySelector(".v-FolderSource--inbox>.v-FolderSource-badge"); | ||
16 | if (!inbox) { | ||
17 | return; | ||
18 | } | ||
19 | const messages = Number(inbox.innerText); | ||
20 | if (!Number.isNaN(messages)) { | ||
21 | Franz.setBadge(messages); | ||
22 | } | ||
23 | }; | ||
24 | |||
25 | Franz.loop(getMessages); | ||
26 | }; | ||
27 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp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