Skip to content

Commit

Permalink
Configure which browser to open in npm start (facebook#873) (facebook…
Browse files Browse the repository at this point in the history
…#1148)

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 alexdriaguine committed Jan 23, 2017
1 parent c2c3728 commit 2457f13
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 2457f13

Please sign in to comment.