Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18 from zaggino/marcel/links-external
Browse files Browse the repository at this point in the history
Open links in an external browser
  • Loading branch information
zaggino committed May 6, 2015
2 parents fed5312 + 265c593 commit af24755
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/appshell/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var utils = require("../utils");
var remote = require("remote");
var electronApp = remote.require("app");
var Menu = remote.require("menu");
var shell = remote.require("shell");
var shellState = remote.require("./shell-state");

var menuTemplate = [];
Expand Down Expand Up @@ -230,8 +231,8 @@ app.openLiveBrowser = function (url, enableRemoteDebugging, callback) {
};

app.openURLInDefaultBrowser = function (url, callback) {
// TODO: implement
callback(new Error("app.openURLInDefaultBrowser not implemented" + url));
shell.openExternal(url);
callback(app.NO_ERROR);
};

app.quit = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ define(function (require, exports, module) {
var node = e.target, url;
while (node) {
if (node.tagName === "A") {
e.preventDefault();
url = node.getAttribute("href");
if (url && !url.match(/^#/)) {
NativeApp.openURLInDefaultBrowser(url);
}
e.preventDefault();
break;
}
node = node.parentElement;
Expand Down

0 comments on commit af24755

Please sign in to comment.