diff --git a/recipes/franz-custom-website/package.json b/recipes/franz-custom-website/package.json index 7aee178c0..28173bab4 100644 --- a/recipes/franz-custom-website/package.json +++ b/recipes/franz-custom-website/package.json @@ -1,7 +1,7 @@ { "id": "franz-custom-website", "name": "Custom Website", - "version": "1.5.1", + "version": "1.6.0", "license": "MIT", "repository": "https://github.com/meetfranz/recipe-custom-website", "config": { diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js index 18f16a3ba..24512913c 100644 --- a/recipes/franz-custom-website/webview.js +++ b/recipes/franz-custom-website/webview.js @@ -7,6 +7,8 @@ const _path = _interopRequireDefault(require('path')); module.exports = (Ferdium, settings) => { Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); + if (settings.trapLinkClicks === true) return; + // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences document.addEventListener( 'click', @@ -22,12 +24,7 @@ module.exports = (Ferdium, settings) => { if (!Ferdium.isImage(link)) { event.preventDefault(); event.stopPropagation(); - - if (settings.trapLinkClicks === true) { - window.location.href = url; - } else { - Ferdium.openNewWindow(url); - } + Ferdium.openNewWindow(url); } } },