Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
handle links in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jan 31, 2017
1 parent 5220b01 commit b71e418
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const windowStateKeeper = require('electron-window-state')
const isDev = require('electron-is-dev');
const log = require('electron-log')
log.transports.file.level = 'info';
const shell = require('electron').shell;

app.setName('Standard Notes');

Expand Down Expand Up @@ -82,6 +83,13 @@ function createWindow () {
win.loadURL(url);
});

// handle link clicks
win.webContents.on('new-window', function(e, url) {
e.preventDefault();
shell.openExternal(url);
});

// auto updater
autoUpdater.logger = log
if(!isDev) {
autoUpdater.checkForUpdates();
Expand Down Expand Up @@ -131,9 +139,6 @@ app.on('ready', function(){
{
role: 'pasteandmatchstyle'
},
{
role: 'delete'
},
{
role: 'selectall'
}
Expand Down

0 comments on commit b71e418

Please sign in to comment.