From 96e2e643f6b283846d8e1d4cbce0bf5494cf21d2 Mon Sep 17 00:00:00 2001 From: Arthur Huan Date: Sun, 22 Oct 2023 16:50:28 -0600 Subject: [PATCH 1/2] Update Messenger link handling --- recipes/messenger/webview.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 39ea09859..781436b5a 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js @@ -14,7 +14,7 @@ function hideInstallMessage() { } } -module.exports = Ferdium => { +module.exports = (Ferdium, settings) => { const getMessages = () => { let count = 0; let newMessengerUI = false; @@ -101,4 +101,29 @@ module.exports = Ferdium => { return notification; }); } + + document.addEventListener( + 'click', + event => { + const link = event.target.closest('a[href^="http"]'); + const button = event.target.closest('button[title^="http"]'); + + if (link || button) { + const url = link + ? link.getAttribute('href') + : button.getAttribute('title'); + + event.preventDefault(); + event.stopPropagation(); + + if (url.includes('fbsbx.com') || settings.trapLinkClicks === true) { + // 'fbsbx.com is Facebook file hosting service. Always open file downloads in Ferdium. + window.location.href = url; + } else { + Ferdium.openNewWindow(url); + } + } + }, + true, + ); }; From f27112ca59da1f709667260ec3b736836a6c225c Mon Sep 17 00:00:00 2001 From: Alphrag <34252790+Alphrag@users.noreply.github.com> Date: Sun, 5 Nov 2023 22:42:00 +0000 Subject: [PATCH 2/2] Bump version number --- recipes/messenger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/messenger/package.json b/recipes/messenger/package.json index fc49dd92a..a12065deb 100644 --- a/recipes/messenger/package.json +++ b/recipes/messenger/package.json @@ -1,7 +1,7 @@ { "id": "messenger", "name": "Messenger", - "version": "1.8.1", + "version": "1.8.2", "license": "MIT", "config": { "serviceURL": "https://messenger.com",