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/package.json | 2 +- recipes/discord/webview.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'recipes') diff --git a/recipes/discord/package.json b/recipes/discord/package.json index 73a859c..c644d66 100644 --- a/recipes/discord/package.json +++ b/recipes/discord/package.json @@ -1,7 +1,7 @@ { "id": "discord", "name": "Discord", - "version": "1.4.0", + "version": "1.4.1", "license": "MIT", "config": { "serviceURL": "https://discordapp.com/login", 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-54-g00ecf