From 4888a9b39418d3d56b935ece67397fd882aeed9d Mon Sep 17 00:00:00 2001 From: CHaBou Date: Wed, 13 Sep 2017 23:12:30 +0200 Subject: [PATCH] Handle xterm url opening --- app/ui/window.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/ui/window.js b/app/ui/window.js index e4d45e90..d52f5f7d 100644 --- a/app/ui/window.js +++ b/app/ui/window.js @@ -199,6 +199,15 @@ module.exports = class Window { } }); + // xterm makes link clickable + window.webContents.on('new-window', (event, url) => { + const protocol = typeof url === 'string' && parseUrl(url).protocol; + if (protocol === 'http:' || protocol === 'https:') { + event.preventDefault(); + shell.openExternal(url); + } + }); + // expose internals to extension authors window.rpc = rpc; window.sessions = sessions;