diff options
author | vantezzen <hello@vantezzen.io> | 2019-12-20 19:22:21 +0100 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-12-20 19:22:21 +0100 |
commit | a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4 (patch) | |
tree | fb19d5c6cb80005059b456e4ba7ce4710f388b5f /uncompressed/skype | |
parent | #15 Add mastodon recipe (diff) | |
parent | Add Zimbra recipe (diff) | |
download | ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.tar.gz ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.tar.zst ferdium-recipes-a54d5cfa8564ee77f1a08972edb1f4bdfe4248a4.zip |
Merge branch 'master' of https://github.com/getferdi/recipes
Diffstat (limited to 'uncompressed/skype')
-rw-r--r-- | uncompressed/skype/package.json | 4 | ||||
-rw-r--r-- | uncompressed/skype/webview.js | 35 |
2 files changed, 36 insertions, 3 deletions
diff --git a/uncompressed/skype/package.json b/uncompressed/skype/package.json index 4b52996..4ca6899 100644 --- a/uncompressed/skype/package.json +++ b/uncompressed/skype/package.json | |||
@@ -1,13 +1,13 @@ | |||
1 | { | 1 | { |
2 | "id": "skype", | 2 | "id": "skype", |
3 | "name": "Skype", | 3 | "name": "Skype", |
4 | "version": "1.1.1", | 4 | "version": "1.2.0", |
5 | "description": "Skype", | 5 | "description": "Skype", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Stefan Malzner <stefan@adlk.io>", | 7 | "author": "Stefan Malzner <stefan@adlk.io>", |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "config": { | 9 | "config": { |
10 | "serviceURL": "https://preview.web.skype.com/", | 10 | "serviceURL": "https://web.skype.com/", |
11 | "hasNotificationSound": true | 11 | "hasNotificationSound": true |
12 | } | 12 | } |
13 | } | 13 | } |
diff --git a/uncompressed/skype/webview.js b/uncompressed/skype/webview.js index 798eccb..12ad2a8 100644 --- a/uncompressed/skype/webview.js +++ b/uncompressed/skype/webview.js | |||
@@ -1,6 +1,12 @@ | |||
1 | "use strict"; | 1 | "use strict"; |
2 | 2 | ||
3 | module.exports = Franz => { | 3 | var _electron = require("electron"); |
4 | |||
5 | const { | ||
6 | BrowserWindow | ||
7 | } = _electron.remote; | ||
8 | |||
9 | module.exports = (Franz, settings) => { | ||
4 | const getMessages = function getMessages() { | 10 | const getMessages = function getMessages() { |
5 | let count = 0; | 11 | let count = 0; |
6 | const container = document.querySelector('[role="tablist"] > [title="Chats"] > div'); | 12 | const container = document.querySelector('[role="tablist"] > [title="Chats"] > div'); |
@@ -22,4 +28,31 @@ module.exports = Franz => { | |||
22 | }; | 28 | }; |
23 | 29 | ||
24 | Franz.loop(getMessages); | 30 | Franz.loop(getMessages); |
31 | document.addEventListener('click', event => { | ||
32 | const link = event.target.closest('a[href^="http"]'); | ||
33 | const button = event.target.closest('button[title^="http"]'); | ||
34 | |||
35 | if (link || button) { | ||
36 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); | ||
37 | event.preventDefault(); | ||
38 | event.stopPropagation(); | ||
39 | |||
40 | if (url.includes('views/imgpsh_fullsize_anim')) { | ||
41 | let win = new BrowserWindow({ | ||
42 | width: 800, | ||
43 | height: window.innerHeight, | ||
44 | minWidth: 600, | ||
45 | webPreferences: { | ||
46 | partition: `persist:service-${settings.id}` | ||
47 | } | ||
48 | }); | ||
49 | win.loadURL(url); | ||
50 | win.on('closed', () => { | ||
51 | win = null; | ||
52 | }); | ||
53 | } else { | ||
54 | window.open(url); | ||
55 | } | ||
56 | } | ||
57 | }, true); | ||
25 | }; \ No newline at end of file | 58 | }; \ No newline at end of file |