diff options
author | Vijay A <avijayr@protonmail.com> | 2021-09-27 09:03:25 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-09-27 09:03:25 +0530 |
commit | eb893bfca211204303fc4c0dc115bad249c6145c (patch) | |
tree | 6adbac4e3efc201113d04201cc940d3d9d98b5e6 /recipes/steamchat/webview.js | |
parent | refactor: remove references 'Ferdi.ipcRenderer' in recipes - create an abstra... (diff) | |
download | ferdium-recipes-eb893bfca211204303fc4c0dc115bad249c6145c.tar.gz ferdium-recipes-eb893bfca211204303fc4c0dc115bad249c6145c.tar.zst ferdium-recipes-eb893bfca211204303fc4c0dc115bad249c6145c.zip |
refactor: remove references 'Ferdi.ipcRenderer' in recipes - create an abstraction layer instead for better maintainance
Diffstat (limited to 'recipes/steamchat/webview.js')
-rw-r--r-- | recipes/steamchat/webview.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/recipes/steamchat/webview.js b/recipes/steamchat/webview.js index d1d3d15..61d57ad 100644 --- a/recipes/steamchat/webview.js +++ b/recipes/steamchat/webview.js | |||
@@ -29,10 +29,9 @@ module.exports = Ferdi => { | |||
29 | const link = event.target.closest('a[href^="http"]'); | 29 | const link = event.target.closest('a[href^="http"]'); |
30 | 30 | ||
31 | if (link && link.getAttribute('target') === '_top') { | 31 | if (link && link.getAttribute('target') === '_top') { |
32 | const url = link.getAttribute('href'); | ||
33 | event.preventDefault(); | 32 | event.preventDefault(); |
34 | event.stopPropagation(); | 33 | event.stopPropagation(); |
35 | Ferdi.ipcRenderer.sendToHost('new-window', url); | 34 | Ferdi.openNewWindow(link.getAttribute('href')); |
36 | } | 35 | } |
37 | }, true); | 36 | }, true); |
38 | }; | 37 | }; |