Handle xterm url opening

This commit is contained in:
CHaBou 2017-09-13 23:12:30 +02:00
parent 9bd410f1e4
commit 4888a9b394
No known key found for this signature in database
GPG key ID: EF8D073B729A0B33

View file

@ -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 // expose internals to extension authors
window.rpc = rpc; window.rpc = rpc;
window.sessions = sessions; window.sessions = sessions;