Commit 759806ed authored by Gabriel Aumala's avatar Gabriel Aumala Committed by Dan Abramov
Browse files

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.
parent 2b2b8ff3
No related merge requests found
Showing with 2 additions and 1 deletion
+2 -1
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment