MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / downloadBrowser

Function downloadBrowser

packages/cli/src/browser/manager.ts:376–397  ·  view source on GitHub ↗
(options?: EnsureBrowserOptions)

Source from the content-addressed store, hash-verified

374}
375
376async function downloadBrowser(options?: EnsureBrowserOptions): Promise<BrowserResult> {
377 if (isLinuxArm()) {
378 return ensureLinuxArmBrowser(options);
379 }
380
381 const { Browser, detectBrowserPlatform, install } = await loadPuppeteerBrowsers();
382
383 const platform = detectBrowserPlatform();
384 if (!platform) {
385 throw new Error(`Unsupported platform: ${process.platform} ${process.arch}`);
386 }
387
388 const installed = await install({
389 cacheDir: CACHE_DIR,
390 browser: Browser.CHROMEHEADLESSSHELL,
391 buildId: CHROME_VERSION,
392 platform,
393 downloadProgressCallback: options?.onProgress,
394 });
395
396 return { executablePath: installed.executablePath, source: "download" };
397}
398
399/**
400 * Remove the cached Chrome download directory.

Callers 2

findBrowserFunction · 0.85
ensureBrowserFunction · 0.85

Calls 4

isLinuxArmFunction · 0.85
ensureLinuxArmBrowserFunction · 0.85
loadPuppeteerBrowsersFunction · 0.85
installFunction · 0.85

Tested by

no test coverage detected