Skip to content

Commit e8987ae

Browse files
GAumalarandycoulman
authored andcommitted
Configure which browser to open in npm start (facebook#873) (facebook#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.
1 parent 2a008a0 commit e8987ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-dev-utils/openBrowser.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ function openBrowser(url) {
2828
// Fallback to opn
2929
// (It will always open new tab)
3030
try {
31-
opn(url).catch(() => {}); // Prevent `unhandledRejection` error.
31+
var option = {app: process.env.BROWSER};
32+
opn(url, option).catch(() => {}); // Prevent `unhandledRejection` error.
3233
return true;
3334
} catch (err) {
3435
return false;

0 commit comments

Comments
 (0)