Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/cli/src/beats/headlessAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export async function analyzeBeatsHeadless(audioBytes: Buffer): Promise<Headless
const browser = await ensureBrowser();
const chrome: Browser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath: browser.executablePath,
args: ["--no-sandbox", "--disable-dev-shm-usage", "--autoplay-policy=no-user-gesture-required"],
});
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/capture/captureCompositionFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export async function openSettledCompositionPage(
try {
chromeBrowser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath: browser.executablePath,
args: buildChromeArgs(
{ ...viewport, captureMode: "screenshot" },
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/capture/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export async function captureWebsite(
const puppeteer = await import("puppeteer-core");
const chromeBrowser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath: browser.executablePath,
protocolTimeout: captureProtocolTimeoutMs(timeout, budgetMs),
args: [
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ async function runLayoutAudit(
assertWebGpuRequirement(html, requestedGpuMode, resolvedGpuMode);
chromeBrowser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath: browser.executablePath,
args: buildChromeArgs(
{ width: 1920, height: 1080, captureMode: "screenshot" },
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/motionShot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ async function openCompositionPage(
assertWebGpuRequirement(html, requestedGpuMode, resolvedGpuMode);
const browser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath,
args: buildChromeArgs(
{ ...size, captureMode: "screenshot" },
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ async function validateInBrowser(
assertWebGpuRequirement(html, requestedGpuMode, resolvedGpuMode);
const chromeBrowser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath: browser.executablePath,
args: buildChromeArgs(
{ ...viewport, captureMode: "screenshot" },
Expand Down
12 changes: 10 additions & 2 deletions packages/engine/src/services/browserManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ async function probeHardwareWebGlInfo(
defaultViewport: { width: 64, height: 64 },
executablePath: options.executablePath,
timeout: options.browserTimeout,
});
// Prevent visible console window on Windows for console-subsystem
// chrome-headless-shell.exe (see #3430).
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
} as any);
const page = await probeBrowser.newPage();
return await page.evaluate(() => {
const unavailable = { hasWebGL: false, vendor: "", renderer: "" };
Expand Down Expand Up @@ -701,7 +705,11 @@ async function launchBrowser(
executablePath: fingerprint.executablePath,
timeout: fingerprint.browserTimeoutMs,
protocolTimeout: fingerprint.protocolTimeoutMs,
});
// Prevent visible console window on Windows for console-subsystem
// chrome-headless-shell.exe (see #3430).
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
} as any);

const browserVersion = await browser.version().catch(() => "unknown");
const gpuFlags = fingerprint.args.filter(
Expand Down
2 changes: 2 additions & 0 deletions packages/producer/src/parity-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ async function run(): Promise<void> {
const browser = await puppeteer.launch({
...browserTarget,
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
defaultViewport: {
width: options.width,
height: options.height,
Expand Down
2 changes: 2 additions & 0 deletions packages/studio/vite.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ async function getSharedBrowser(): Promise<import("puppeteer-core").Browser | nu
if (!executablePath) return null;
browser = await puppeteer.default.launch({
headless: true,
// @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430)
windowsHide: true,
executablePath,
args: [
"--no-sandbox",
Expand Down