Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 759806e

Browse files
GAumalagaearon
authored andcommitted
Configure which browser to open in npm start (#873) (#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 2b2b8ff commit 759806e

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)