From bb21faf4502832a32bd994f47b48ce5068562bf4 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 18 Mar 2021 00:23:23 -0700 Subject: [PATCH] fix: disable firefox's webrender on Darwin (#5870) References #5721 --- src/server/firefox/firefox.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/server/firefox/firefox.ts b/src/server/firefox/firefox.ts index 15bfbc672e..fc6a79e24e 100644 --- a/src/server/firefox/firefox.ts +++ b/src/server/firefox/firefox.ts @@ -42,13 +42,21 @@ export class Firefox extends BrowserType { _amendEnvironment(env: Env, userDataDir: string, executable: string, browserArguments: string[]): Env { if (!path.isAbsolute(os.homedir())) throw new Error(`Cannot launch Firefox with relative home directory. Did you set ${os.platform() === 'win32' ? 'USERPROFILE' : 'HOME'} to a relative path?`); - return os.platform() === 'linux' ? { - ...env, - // On linux Juggler ships the libstdc++ it was linked against. - LD_LIBRARY_PATH: `${path.dirname(executable)}:${process.env.LD_LIBRARY_PATH}`, - // @see https://github.com/microsoft/playwright/issues/5721 - MOZ_WEBRENDER: 0, - } : env; + if (os.platform() === 'linux') { + return { + ...env, + // On linux Juggler ships the libstdc++ it was linked against. + LD_LIBRARY_PATH: `${path.dirname(executable)}:${process.env.LD_LIBRARY_PATH}`, + }; + } + if (os.platform() === 'darwin') { + return { + ...env, + // @see https://github.com/microsoft/playwright/issues/5721 + MOZ_WEBRENDER: 0, + }; + } + return env; } _attemptToGracefullyCloseBrowser(transport: ConnectionTransport): void {