fix: reset SNAP* env variables when launching Firefox (#20692)
Our builds never come from Snap, so Playwright's Firefox should never consider that it's been installed via SNAP. Fixes #20555 --------- Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com> Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
439d3cefcf
commit
d3c5430080
|
|
@ -46,6 +46,12 @@ export class Firefox extends BrowserType {
|
||||||
_amendEnvironment(env: Env, userDataDir: string, executable: string, browserArguments: string[]): Env {
|
_amendEnvironment(env: Env, userDataDir: string, executable: string, browserArguments: string[]): Env {
|
||||||
if (!path.isAbsolute(os.homedir()))
|
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?`);
|
throw new Error(`Cannot launch Firefox with relative home directory. Did you set ${os.platform() === 'win32' ? 'USERPROFILE' : 'HOME'} to a relative path?`);
|
||||||
|
if (os.platform() === 'linux') {
|
||||||
|
// Always remove SNAP_NAME and SNAP_INSTANCE_NAME env variables since they
|
||||||
|
// confuse Firefox: in our case, builds never come from SNAP.
|
||||||
|
// See https://github.com/microsoft/playwright/issues/20555
|
||||||
|
return { ...env, SNAP_NAME: undefined, SNAP_INSTANCE_NAME: undefined };
|
||||||
|
}
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue