Merge pull request #3 from lneir/open-external-url

open url in default browser
This commit is contained in:
Lynn 2016-11-09 01:13:49 +00:00 committed by GitHub
commit e694837b24

View File

@ -59,6 +59,12 @@ function createWindow () {
// when you should delete the corresponding element.
mainWindow = null;
});
// open external links in default browser
mainWindow.webContents.on('new-window', function(event, url) {
event.preventDefault();
electron.shell.openExternal(url);
});
}
// This method will be called when Electron has finished