Skip to content

Commit

Permalink
Open links in default browser
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSandstrom committed Nov 2, 2015
1 parent 3fad334 commit 7570719
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const path = require('path');
const BrowserWindow = require('browser-window');
const Menu = require('menu');
const appMenu = require('./menu');
var shell = require('shell');

// report crashes to the Electron project
require('crash-reporter').start();
Expand All @@ -28,6 +29,10 @@ function createTeamWindow(team) {
});

win.loadUrl('https://' + team + '.hipchat.com/chat');
win.webContents.on('new-window', (e, url) => {
e.preventDefault();
shell.openExternal(url);
});
win.webContents.on('did-finish-load', () => {
if (team !== 'www') {
win.setTitle(team);
Expand Down

0 comments on commit 7570719

Please sign in to comment.