aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/steamchat/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/steamchat/webview.js')
-rw-r--r--recipes/steamchat/webview.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/recipes/steamchat/webview.js b/recipes/steamchat/webview.js
index cfe84f3..1188c71 100644
--- a/recipes/steamchat/webview.js
+++ b/recipes/steamchat/webview.js
@@ -30,17 +30,13 @@ module.exports = Ferdium => {
30 30
31 Ferdium.loop(getMessages); 31 Ferdium.loop(getMessages);
32 32
33 document.addEventListener( 33 document.addEventListener('click', event => {
34 'click', 34 const link = event.target.closest('a[href^="http"]');
35 event => {
36 const link = event.target.closest('a[href^="http"]');
37 35
38 if (link && link.getAttribute('target') === '_top') { 36 if (link && link.getAttribute('target') === '_top') {
39 event.preventDefault(); 37 event.preventDefault();
40 event.stopPropagation(); 38 event.stopPropagation();
41 Ferdium.openNewWindow(link.getAttribute('href')); 39 Ferdium.openNewWindow(link.getAttribute('href'));
42 } 40 }
43 }, 41 }, true);
44 true,
45 );
46}; 42};