From 4983daff125009865f8482388c37f69de8a610f7 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Mon, 23 May 2022 05:55:44 -0500 Subject: Add new service-level option 'trapLinkUrls' (#30) This option can be used to allow the user to choose how to handle links (whether to open in the default browser or within the Ferdium service itself) Removed incorrect 'if' condition for zoom and discord for clickHandler --- recipes/skype/webview.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'recipes/skype/webview.js') diff --git a/recipes/skype/webview.js b/recipes/skype/webview.js index 23e6919..b317d14 100644 --- a/recipes/skype/webview.js +++ b/recipes/skype/webview.js @@ -2,7 +2,7 @@ const _path = _interopRequireDefault(require('path')); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -module.exports = Ferdium => { +module.exports = (Ferdium, settings) => { const getMessages = () => { let count = 0; const container = document.querySelector('[role="tablist"] > button > div'); @@ -41,7 +41,12 @@ module.exports = Ferdium => { if (url.includes('views/imgpsh_fullsize_anim')) { event.preventDefault(); event.stopPropagation(); - Ferdium.openNewWindow(url); + + if (settings.trapLinkClicks === true) { + window.location.href = url; + } else { + Ferdium.openNewWindow(url); + } } } }, true); -- cgit v1.2.3-70-g09d2