MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / startChrome

Function startChrome

tooling/scripts/perf-web-runtime.mjs:297–331  ·  view source on GitHub ↗
({ debugPort, userDataDir })

Source from the content-addressed store, hash-verified

295}
296
297function startChrome({ debugPort, userDataDir }) {
298 const chromePath = findChromePath()
299 const child = spawn(
300 chromePath,
301 [
302 `--remote-debugging-port=${debugPort}`,
303 `--user-data-dir=${userDataDir}`,
304 '--headless=new',
305 '--disable-background-networking',
306 '--disable-default-apps',
307 '--disable-extensions',
308 '--disable-gpu',
309 '--disable-sync',
310 '--js-flags=--expose-gc',
311 '--metrics-recording-only',
312 '--no-default-browser-check',
313 '--no-first-run',
314 'about:blank'
315 ],
316 {
317 stdio: ['ignore', 'pipe', 'pipe']
318 }
319 )
320 let log = ''
321 child.stdout.on('data', (chunk) => {
322 log = appendBounded(log, chunk)
323 })
324 child.stderr.on('data', (chunk) => {
325 log = appendBounded(log, chunk)
326 })
327 return {
328 child,
329 log: () => log
330 }
331}
332
333class CdpClient {
334 constructor(webSocketUrl) {

Callers 1

mainFunction · 0.85

Calls 3

findChromePathFunction · 0.85
appendBoundedFunction · 0.70
onMethod · 0.45

Tested by

no test coverage detected