MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / start

Function start

scripts/run_start.mjs:235–300  ·  view source on GitHub ↗

Launch Chrome with our custom DevTools front-end.

()

Source from the content-addressed store, hash-verified

233
234/** Launch Chrome with our custom DevTools front-end. **/
235async function start() {
236 const binary = await findBrowserBinary();
237 /**
238 * @type {string[]}
239 */
240 const args = [];
241
242 // Disable first run experience.
243 args.push('--no-first-run');
244
245 // Custom flags for CfT.
246 if (browser === 'cft') {
247 args.push('--disable-infobars');
248 }
249
250 // Custom flags for macOS.
251 if (process.platform === 'darwin') {
252 args.push('--use-mock-keychain');
253 }
254
255 // Disable/Enable features.
256 const featureSet = new FeatureSet();
257 featureSet.merge(DEFAULT_FEATURE_SET);
258 if (unstableFeatures) {
259 featureSet.merge(UNSTABLE_FEATURE_SET);
260 }
261 for (const { feature } of FeatureSet.parse(disableFeatures)) {
262 featureSet.disable(feature);
263 }
264 for (const { feature, parameters } of FeatureSet.parse(enableFeatures)) {
265 featureSet.enable(feature, parameters);
266 }
267 args.push(...featureSet);
268
269 // Custom flags for Chrome.
270 if (remoteDebuggingPort) {
271 args.push(`--remote-debugging-port=${remoteDebuggingPort}`);
272 }
273 if (userDataDir) {
274 args.push(`--user-data-dir=${userDataDir}`);
275 }
276
277 // Open with our freshly built DevTools front-end.
278 const genDir = path.join(rootPath(), 'out', target, 'gen');
279 const customDevToolsFrontEndPath = isInChromiumDirectory().isInChromium
280 ? path.join(genDir, 'third_party', 'devtools-frontend', 'src', 'front_end')
281 : path.join(genDir, 'front_end');
282 args.push(`--custom-devtools-frontend=file://${customDevToolsFrontEndPath}`);
283
284 // Chrome flags and URLs.
285 if (open) {
286 args.push('--auto-open-devtools-for-tabs');
287 }
288 const restArg = argv._.filter(arg => typeof arg === 'string');
289 args.push(...restArg);
290
291 // Launch Chrome.
292 if (verbose) {

Callers 1

run_start.mjsFile · 0.70

Calls 10

mergeMethod · 0.95
disableMethod · 0.95
enableMethod · 0.95
rootPathFunction · 0.90
isInChromiumDirectoryFunction · 0.90
findBrowserBinaryFunction · 0.85
pushMethod · 0.45
parseMethod · 0.45
joinMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected