From 320f3198eac55ee1597a435d1374d8fd19c98b74 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 27 Jun 2019 20:33:15 +0100 Subject: [PATCH] Fix Electron vector: links Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/webcontents-handler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/electron_app/src/webcontents-handler.js b/electron_app/src/webcontents-handler.js index 4bfb7876..2880cf37 100644 --- a/electron_app/src/webcontents-handler.js +++ b/electron_app/src/webcontents-handler.js @@ -36,7 +36,11 @@ function onWindowOrNavigate(ev, target) { } function onLinkContextMenu(ev, params) { - const url = params.linkURL || params.srcURL; + let url = params.linkURL || params.srcURL; + + if (url.startsWith('vector://vector/webapp')) { + url = "https://riot.im/app/" + url.substring(23); + } const popupMenu = new Menu(); // No point trying to open blob: URLs in an external browser: it ain't gonna work.