diff options
Diffstat (limited to 'recipes/steamchat')
-rw-r--r-- | recipes/steamchat/package.json | 2 | ||||
-rw-r--r-- | recipes/steamchat/webview.js | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/recipes/steamchat/package.json b/recipes/steamchat/package.json index 9489add..9123671 100644 --- a/recipes/steamchat/package.json +++ b/recipes/steamchat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "steamchat", | 2 | "id": "steamchat", |
3 | "name": "SteamChat", | 3 | "name": "SteamChat", |
4 | "version": "1.4.2", | 4 | "version": "1.4.3", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://steamcommunity.com/chat", | 7 | "serviceURL": "https://steamcommunity.com/chat", |
diff --git a/recipes/steamchat/webview.js b/recipes/steamchat/webview.js index 4e8519b..9cb6d64 100644 --- a/recipes/steamchat/webview.js +++ b/recipes/steamchat/webview.js | |||
@@ -33,17 +33,19 @@ module.exports = (Ferdium, settings) => { | |||
33 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences | 33 | // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences |
34 | document.addEventListener('click', event => { | 34 | document.addEventListener('click', event => { |
35 | const link = event.target.closest('a[href^="http"]'); | 35 | const link = event.target.closest('a[href^="http"]'); |
36 | const button = event.target.closest('button[title^="http"]'); | ||
36 | 37 | ||
37 | if (link && link.getAttribute('target') === '_top') { | 38 | if (link || button) { |
38 | event.preventDefault(); | 39 | const url = link ? link.getAttribute('href') : button.getAttribute('title'); |
39 | event.stopPropagation(); | ||
40 | const url = link.getAttribute('href'); | ||
41 | 40 | ||
42 | if (settings.trapLinkClicks === true) { | 41 | event.preventDefault(); |
43 | window.location.href = url; | 42 | event.stopPropagation(); |
44 | } else { | 43 | |
45 | Ferdium.openNewWindow(url); | 44 | if (settings.trapLinkClicks === true) { |
46 | } | 45 | window.location.href = url; |
46 | } else { | ||
47 | Ferdium.openNewWindow(url); | ||
48 | } | ||
47 | } | 49 | } |
48 | }, true); | 50 | }, true); |
49 | }; | 51 | }; |