MCPcopy
hub / github.com/vercel/next.js / newBrowserSession

Function newBrowserSession

turbopack/packages/devlow-bench/src/browser.ts:344–361  ·  view source on GitHub ↗
(options: {
  headless?: boolean
  devtools?: boolean
  baseURL?: string
})

Source from the content-addressed store, hash-verified

342}
343
344export async function newBrowserSession(options: {
345 headless?: boolean
346 devtools?: boolean
347 baseURL?: string
348}): Promise<BrowserSession> {
349 const browser = await chromium.launch({
350 headless: options.headless ?? process.env.HEADLESS !== 'false',
351 args: options.headless ? undefined : ['--auto-open-devtools-for-tabs'],
352 timeout: 60000,
353 })
354 const context = await browser.newContext({
355 baseURL: options.baseURL ?? 'http://localhost:3000',
356 viewport: { width: 1280, height: 720 },
357 })
358 context.setDefaultTimeout(120000)
359 context.setDefaultNavigationTimeout(120000)
360 return new BrowserSessionImpl(browser, context)
361}
362
363// see next.js/test/lib/browsers/playwright.ts

Callers 2

nextBuildWorkflowFunction · 0.90
nextDevWorkflowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected