From 8ae9b8db3d0afa80dd18f3d5102a806f1621062d Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Tue, 14 Feb 2017 12:26:13 -0600 Subject: [PATCH] add file url check --- app/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/index.js b/app/index.js index bbb4778f..fda54e29 100644 --- a/app/index.js +++ b/app/index.js @@ -92,10 +92,12 @@ function createWindow () { }); // handle link clicks (this event is fired instead of - // 'new-window' when target is not set to _blank) + // 'new-window' when target is not set to _blank) win.webContents.on('will-navigate', function(e, url) { - e.preventDefault(); - shell.openExternal(url); + if(!url.includes("file://")) { + e.preventDefault(); + shell.openExternal(url); + } }); // auto updater