diff options
author | 2021-05-28 00:17:39 +0200 | |
---|---|---|
committer | 2021-07-24 00:23:17 +0000 | |
commit | eee1d1483d8e3ebd467d37de1011492ed555e571 (patch) | |
tree | f73b9a0abf991fda83a1183f96c907c183d52dd2 /recipes/fastmail/webview.js | |
parent | [googledrive] Context isolation support (diff) | |
download | ferdium-recipes-eee1d1483d8e3ebd467d37de1011492ed555e571.tar.gz ferdium-recipes-eee1d1483d8e3ebd467d37de1011492ed555e571.tar.zst ferdium-recipes-eee1d1483d8e3ebd467d37de1011492ed555e571.zip |
[fastmail] Context isolation support
Diffstat (limited to 'recipes/fastmail/webview.js')
-rw-r--r-- | recipes/fastmail/webview.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/recipes/fastmail/webview.js b/recipes/fastmail/webview.js index ca5cc9d..df39728 100644 --- a/recipes/fastmail/webview.js +++ b/recipes/fastmail/webview.js | |||
@@ -1,16 +1,8 @@ | |||
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | module.exports = (Franz, options) => { | 3 | const path = require('path'); |
4 | var interval = setInterval(function () { | 4 | |
5 | if (!window.O || !window.O.WindowController) return; | 5 | module.exports = (Franz) => { |
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 = () => { | 6 | const getMessages = () => { |
15 | const inbox = document.querySelector(".v-MailboxSource--inbox .v-MailboxSource-badge"); | 7 | const inbox = document.querySelector(".v-MailboxSource--inbox .v-MailboxSource-badge"); |
16 | if (!inbox) { | 8 | if (!inbox) { |
@@ -22,6 +14,6 @@ module.exports = (Franz, options) => { | |||
22 | } | 14 | } |
23 | }; | 15 | }; |
24 | 16 | ||
17 | Franz.injectJSUnsafe(path.join(__dirname, 'webview-unsafe.js')); | ||
25 | Franz.loop(getMessages); | 18 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