diff options
Diffstat (limited to 'recipes/skype/webview.js')
-rw-r--r-- | recipes/skype/webview.js | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/recipes/skype/webview.js b/recipes/skype/webview.js index ca0befb..47b6f27 100644 --- a/recipes/skype/webview.js +++ b/recipes/skype/webview.js | |||
@@ -2,7 +2,7 @@ const _path = _interopRequireDefault(require('path')); | |||
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | 4 | ||
5 | module.exports = (Ferdium, settings) => { | 5 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 6 | const getMessages = () => { |
7 | let count = 0; | 7 | let count = 0; |
8 | const container = document.querySelector('[role="tablist"] > button > div'); | 8 | const container = document.querySelector('[role="tablist"] > button > div'); |
@@ -30,7 +30,6 @@ module.exports = (Ferdium, settings) => { | |||
30 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | 30 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
31 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 31 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
32 | 32 | ||
33 | // TODO: This whole block is duplicated between the 'discord' and 'skype' recipes - reuse | ||
34 | document.addEventListener('click', event => { | 33 | document.addEventListener('click', event => { |
35 | const link = event.target.closest('a[href^="http"]'); | 34 | const link = event.target.closest('a[href^="http"]'); |
36 | const button = event.target.closest('button[title^="http"]'); | 35 | const button = event.target.closest('button[title^="http"]'); |
@@ -41,22 +40,7 @@ module.exports = (Ferdium, settings) => { | |||
41 | if (url.includes('views/imgpsh_fullsize_anim')) { | 40 | if (url.includes('views/imgpsh_fullsize_anim')) { |
42 | event.preventDefault(); | 41 | event.preventDefault(); |
43 | event.stopPropagation(); | 42 | event.stopPropagation(); |
44 | // TODO: Can we send an ipc event 'open-browser-window' to open the child window? (see the slack recipe for how to send an ipc message) | 43 | Ferdium.openNewWindow(url); |
45 | // TODO: Can we change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/ferdium/ferdium-app/issues/1697) | ||
46 | let win = new Ferdium.BrowserWindow({ | ||
47 | width: 800, | ||
48 | height: window.innerHeight, | ||
49 | minWidth: 600, | ||
50 | webPreferences: { | ||
51 | partition: `persist:service-${settings.id}`, | ||
52 | // TODO: Aren't these needed here? | ||
53 | // contextIsolation: false, | ||
54 | } | ||
55 | }); | ||
56 | win.loadURL(url); | ||
57 | win.on('closed', () => { | ||
58 | win = null; | ||
59 | }); | ||
60 | } | 44 | } |
61 | } | 45 | } |
62 | }, true); | 46 | }, true); |