fix(chromium): enable gpu support in mac headless (#20418)

This commit is contained in:
Dmitry Gozman 2023-01-26 13:21:25 -08:00 committed by GitHub
parent 0c84d88127
commit 332dbc5bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,9 +287,13 @@ export class Chromium extends BrowserType {
throw new Error('Arguments can not specify page to be opened');
const chromeArguments = [...chromiumSwitches];
if (os.platform() === 'darwin') {
// See https://github.com/microsoft/playwright/issues/7362
if (os.platform() === 'darwin')
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');