MCPcopy
hub / github.com/react/create-react-app / openBrowser

Function openBrowser

packages/react-dev-utils/openBrowser.js:138–151  ·  view source on GitHub ↗

* Reads the BROWSER environment variable and decides what to do with it. Returns * true if it opened a browser or ran a node.js script, otherwise false.

(url)

Source from the content-addressed store, hash-verified

136 * true if it opened a browser or ran a node.js script, otherwise false.
137 */
138function openBrowser(url) {
139 const { action, value, args } = getBrowserEnv();
140 switch (action) {
141 case Actions.NONE:
142 // Special case: BROWSER="none" will prevent opening completely.
143 return false;
144 case Actions.SCRIPT:
145 return executeNodeScript(value, url);
146 case Actions.BROWSER:
147 return startBrowserProcess(value, url, args);
148 default:
149 throw new Error('Not implemented.');
150 }
151}
152
153module.exports = openBrowser;

Callers 1

start.jsFile · 0.85

Calls 3

getBrowserEnvFunction · 0.85
startBrowserProcessFunction · 0.85
executeNodeScriptFunction · 0.70

Tested by

no test coverage detected