Skip to content

Commit

Permalink
Configure which browser to open in npm start (#873) (#1148)
Browse files Browse the repository at this point in the history
Use a 'BROWSER' environment variable with npm start to specify which
browser to open. if the value of 'BROWSER' is not valid executable file,
don't open any browser.
  • Loading branch information
GAumala authored and gaearon committed Dec 11, 2016
1 parent 2b2b8ff commit 759806e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function openBrowser(url) {
// Fallback to opn
// (It will always open new tab)
try {
opn(url).catch(() => {}); // Prevent `unhandledRejection` error.
var option = {app: process.env.BROWSER};
opn(url, option).catch(() => {}); // Prevent `unhandledRejection` error.
return true;
} catch (err) {
return false;
Expand Down

0 comments on commit 759806e

Please sign in to comment.