From abaf1390f1975243bbe5daa6530140d913bd92af Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Tue, 21 Jun 2016 16:45:33 -0300 Subject: [PATCH] Fixes #1 --- app/ux/WebView.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/ux/WebView.js b/app/ux/WebView.js index 5a568cc3..09563724 100644 --- a/app/ux/WebView.js +++ b/app/ux/WebView.js @@ -84,8 +84,11 @@ Ext.define('Rambox.ux.WebView',{ if ( !webview.isAudioMuted() && me.muted ) webview.setAudioMuted(me.muted); // Open links in default browser - webview.addEventListener('new-window', function(e) { - require('remote').shell.openExternal(e.url); + webview.addEventListener('new-window', (e) => { + const protocol = require('url').parse(e.url).protocol; + if (protocol === 'http:' || protocol === 'https:') { + require('electron').shell.openExternal(e.url); + } }); // Injected code to detect new messages