From 76535ca9dedd5082a13d83e77d293a03fd429675 Mon Sep 17 00:00:00 2001 From: Brian Kendall <7917884+briankendall@users.noreply.github.com> Date: Wed, 15 Sep 2021 13:11:57 -0400 Subject: Fix images opening in browser instead of in Discord (#712) --- recipes/discord/webview.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'recipes/discord/webview.js') diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index 480329d..9c96f9f 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js @@ -93,10 +93,10 @@ module.exports = (Ferdi, settings) => { if (link || button) { const url = link ? link.getAttribute('href') : button.getAttribute('title'); - event.preventDefault(); - event.stopPropagation(); if (url.includes('views/imgpsh_fullsize_anim')) { + event.preventDefault(); + event.stopPropagation(); let win = new Ferdi.BrowserWindow({ width: 800, height: window.innerHeight, @@ -109,8 +109,6 @@ module.exports = (Ferdi, settings) => { win.on('closed', () => { win = null; }); - } else { - window.open(url); } } }, true); -- cgit v1.2.3-70-g09d2