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

Function ensureBrowser

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

Source from the content-addressed store, hash-verified

352 * Resolution: env var -> cached download -> system Chrome -> auto-download.
353 */
354export async function ensureBrowser(options?: EnsureBrowserOptions): Promise<BrowserResult> {
355 const fromEnv = findFromEnv();
356 if (fromEnv) return fromEnv;
357
358 const fromCache = await findFromCache();
359 if (fromCache.result) return fromCache.result;
360 if (fromCache.staleHyperframesCachePath) {
361 console.warn(
362 `[browser] Cached binary missing at ${fromCache.staleHyperframesCachePath} — re-downloading...`,
363 );
364 return downloadBrowser(options);
365 }
366
367 const fromSystem = findFromSystem();
368 if (fromSystem) {
369 warnSystemFallbackOnce(fromSystem.executablePath);
370 return fromSystem;
371 }
372
373 return downloadBrowser(options);
374}
375
376async function downloadBrowser(options?: EnsureBrowserOptions): Promise<BrowserResult> {
377 if (isLinuxArm()) {

Callers 11

runFunction · 0.85
runEnsureFunction · 0.85
runPathFunction · 0.85
runLayoutAuditFunction · 0.85
validateInBrowserFunction · 0.85
captureSnapshotsFunction · 0.85
captureMotionPathShotFunction · 0.85
captureWebsiteFunction · 0.85
getThumbnailBrowserFunction · 0.85
startRenderFunction · 0.85
analyzeBeatsHeadlessFunction · 0.85

Calls 6

findFromCacheFunction · 0.85
downloadBrowserFunction · 0.85
warnSystemFallbackOnceFunction · 0.85
warnMethod · 0.80
findFromEnvFunction · 0.70
findFromSystemFunction · 0.70

Tested by

no test coverage detected