mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
feat(firefox): process.env.PLAYWRIGHT_DISABLE_FIREFOX_CROSS_PROCESS (#18458)
This commit is contained in:
parent
84aa67a7fc
commit
9cc5ca0cd4
@ -26,7 +26,7 @@ import type { ConnectionTransport } from '../transport';
|
|||||||
import type { BrowserOptions, PlaywrightOptions } from '../browser';
|
import type { BrowserOptions, PlaywrightOptions } from '../browser';
|
||||||
import type * as types from '../types';
|
import type * as types from '../types';
|
||||||
import { rewriteErrorMessage } from '../../utils/stackTrace';
|
import { rewriteErrorMessage } from '../../utils/stackTrace';
|
||||||
import { wrapInASCIIBox } from '../../utils';
|
import { getAsBooleanFromENV, wrapInASCIIBox } from '../../utils';
|
||||||
|
|
||||||
export class Firefox extends BrowserType {
|
export class Firefox extends BrowserType {
|
||||||
constructor(playwrightOptions: PlaywrightOptions) {
|
constructor(playwrightOptions: PlaywrightOptions) {
|
||||||
@ -61,7 +61,11 @@ export class Firefox extends BrowserType {
|
|||||||
throw new Error('Pass userDataDir parameter to `browserType.launchPersistentContext(userDataDir, ...)` instead of specifying --profile argument');
|
throw new Error('Pass userDataDir parameter to `browserType.launchPersistentContext(userDataDir, ...)` instead of specifying --profile argument');
|
||||||
if (args.find(arg => arg.startsWith('-juggler')))
|
if (args.find(arg => arg.startsWith('-juggler')))
|
||||||
throw new Error('Use the port parameter instead of -juggler argument');
|
throw new Error('Use the port parameter instead of -juggler argument');
|
||||||
const firefoxUserPrefs = isPersistent ? undefined : { ...kBandaidFirefoxUserPrefs, ...options.firefoxUserPrefs };
|
let firefoxUserPrefs = isPersistent ? undefined : options.firefoxUserPrefs;
|
||||||
|
if (getAsBooleanFromENV('PLAYWRIGHT_DISABLE_FIREFOX_CROSS_PROCESS'))
|
||||||
|
firefoxUserPrefs = { ...kDisableFissionFirefoxUserPrefs, ...firefoxUserPrefs };
|
||||||
|
if (Object.keys(kBandaidFirefoxUserPrefs).length)
|
||||||
|
firefoxUserPrefs = { ...kBandaidFirefoxUserPrefs, ...firefoxUserPrefs };
|
||||||
if (firefoxUserPrefs) {
|
if (firefoxUserPrefs) {
|
||||||
const lines: string[] = [];
|
const lines: string[] = [];
|
||||||
for (const [name, value] of Object.entries(firefoxUserPrefs))
|
for (const [name, value] of Object.entries(firefoxUserPrefs))
|
||||||
@ -90,3 +94,11 @@ export class Firefox extends BrowserType {
|
|||||||
// Should all be moved to `playwright.cfg`.
|
// Should all be moved to `playwright.cfg`.
|
||||||
const kBandaidFirefoxUserPrefs = {
|
const kBandaidFirefoxUserPrefs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const kDisableFissionFirefoxUserPrefs = {
|
||||||
|
'browser.tabs.remote.useCrossOriginEmbedderPolicy': false,
|
||||||
|
'browser.tabs.remote.useCrossOriginOpenerPolicy': false,
|
||||||
|
'browser.tabs.remote.separatePrivilegedMozillaWebContentProcess': false,
|
||||||
|
'fission.autostart': false,
|
||||||
|
'browser.tabs.remote.systemTriggeredAboutBlankAnywhere': true,
|
||||||
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user