aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/steamchat
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-05-23 05:55:44 -0500
committerLibravatar GitHub <noreply@github.com>2022-05-23 10:55:44 +0000
commit4983daff125009865f8482388c37f69de8a610f7 (patch)
tree4f58493028c4a2ba683da79c32676b45590cda9c /recipes/steamchat
parentSupport for self-hosted github (diff)
downloadferdium-recipes-4983daff125009865f8482388c37f69de8a610f7.tar.gz
ferdium-recipes-4983daff125009865f8482388c37f69de8a610f7.tar.zst
ferdium-recipes-4983daff125009865f8482388c37f69de8a610f7.zip
Add new service-level option 'trapLinkUrls' (#30)
This option can be used to allow the user to choose how to handle links (whether to open in the default browser or within the Ferdium service itself) Removed incorrect 'if' condition for zoom and discord for clickHandler
Diffstat (limited to 'recipes/steamchat')
-rw-r--r--recipes/steamchat/package.json2
-rw-r--r--recipes/steamchat/webview.js10
2 files changed, 9 insertions, 3 deletions
diff --git a/recipes/steamchat/package.json b/recipes/steamchat/package.json
index 28434b1..9489add 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.1", 4 "version": "1.4.2",
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 3773bad..4e8519b 100644
--- a/recipes/steamchat/webview.js
+++ b/recipes/steamchat/webview.js
@@ -1,4 +1,4 @@
1module.exports = Ferdium => { 1module.exports = (Ferdium, settings) => {
2 const getMessages = () => { 2 const getMessages = () => {
3 // get new msg count 3 // get new msg count
4 let count = 0; 4 let count = 0;
@@ -37,7 +37,13 @@ module.exports = Ferdium => {
37 if (link && link.getAttribute('target') === '_top') { 37 if (link && link.getAttribute('target') === '_top') {
38 event.preventDefault(); 38 event.preventDefault();
39 event.stopPropagation(); 39 event.stopPropagation();
40 Ferdium.openNewWindow(link.getAttribute('href')); 40 const url = link.getAttribute('href');
41
42 if (settings.trapLinkClicks === true) {
43 window.location.href = url;
44 } else {
45 Ferdium.openNewWindow(url);
46 }
41 } 47 }
42 }, true); 48 }, true);
43}; 49};