From 332dbc5bf6cf68c3fad5857ebc30ed09599333c5 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 26 Jan 2023 13:21:25 -0800 Subject: [PATCH] fix(chromium): enable gpu support in mac headless (#20418) --- packages/playwright-core/src/server/chromium/chromium.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts index 8aa3d8edec..d1239b7d6f 100644 --- a/packages/playwright-core/src/server/chromium/chromium.ts +++ b/packages/playwright-core/src/server/chromium/chromium.ts @@ -287,9 +287,13 @@ export class Chromium extends BrowserType { throw new Error('Arguments can not specify page to be opened'); const chromeArguments = [...chromiumSwitches]; - // See https://github.com/microsoft/playwright/issues/7362 - if (os.platform() === 'darwin') + if (os.platform() === 'darwin') { + // See https://github.com/microsoft/playwright/issues/7362 chromeArguments.push('--enable-use-zoom-for-dsf=false'); + // See https://bugs.chromium.org/p/chromium/issues/detail?id=1407025. + if (options.headless) + chromeArguments.push('--use-angle'); + } if (options.devtools) chromeArguments.push('--auto-open-devtools-for-tabs');