mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: do not pass chromium args when running carlo-alike apps (#21782)
This commit is contained in:
parent
8a65cf9aac
commit
f151c45c91
@ -75,7 +75,7 @@ export abstract class BrowserType extends SdkObject {
|
||||
return browser;
|
||||
}
|
||||
|
||||
async launchPersistentContext(metadata: CallMetadata, userDataDir: string, options: channels.BrowserTypeLaunchPersistentContextOptions & { useWebSocket?: boolean }): Promise<BrowserContext> {
|
||||
async launchPersistentContext(metadata: CallMetadata, userDataDir: string, options: channels.BrowserTypeLaunchPersistentContextOptions & { useWebSocket?: boolean, ignoreChromiumSwitches?: boolean }): Promise<BrowserContext> {
|
||||
options = this._validateLaunchOptions(options);
|
||||
const controller = new ProgressController(metadata, this);
|
||||
const persistent: channels.BrowserNewContextParams = options;
|
||||
|
||||
@ -283,7 +283,7 @@ export class Chromium extends BrowserType {
|
||||
throw new Error('Playwright manages remote debugging connection itself.');
|
||||
if (args.find(arg => !arg.startsWith('-')))
|
||||
throw new Error('Arguments can not specify page to be opened');
|
||||
const chromeArguments = [...chromiumSwitches];
|
||||
const chromeArguments = options.ignoreChromiumSwitches ? [] : [...chromiumSwitches];
|
||||
|
||||
if (os.platform() === 'darwin') {
|
||||
// See https://github.com/microsoft/playwright/issues/7362
|
||||
|
||||
@ -129,7 +129,10 @@ export class RecorderApp extends EventEmitter implements IRecorderApp {
|
||||
args,
|
||||
noDefaultViewport: true,
|
||||
colorScheme: 'no-override',
|
||||
ignoreDefaultArgs: ['--enable-automation'],
|
||||
// Moving the mouse while starting Chromium on macOS kills the mouse.
|
||||
// There is no exact switch that we can blame, but removing all reduces the
|
||||
// probability of this happening by a couple of orders.
|
||||
ignoreChromiumSwitches: true,
|
||||
headless: !!process.env.PWTEST_CLI_HEADLESS || (isUnderTest() && !headed),
|
||||
useWebSocket: !!process.env.PWTEST_RECORDER_PORT,
|
||||
handleSIGINT,
|
||||
|
||||
@ -86,7 +86,10 @@ export async function showTraceViewer(traceUrls: string[], browserName: string,
|
||||
channel: findChromiumChannel(traceViewerPlaywright.options.sdkLanguage),
|
||||
args,
|
||||
noDefaultViewport: true,
|
||||
ignoreDefaultArgs: ['--enable-automation'],
|
||||
// Moving the mouse while starting Chromium on macOS kills the mouse.
|
||||
// There is no exact switch that we can blame, but removing all reduces the
|
||||
// probability of this happening by a couple of orders.
|
||||
ignoreChromiumSwitches: true,
|
||||
headless,
|
||||
colorScheme: 'no-override',
|
||||
useWebSocket: isUnderTest(),
|
||||
|
||||
@ -149,7 +149,7 @@ export type NormalizedContinueOverrides = {
|
||||
|
||||
export type EmulatedSize = { viewport: Size, screen: Size };
|
||||
|
||||
export type LaunchOptions = channels.BrowserTypeLaunchOptions & { useWebSocket?: boolean };
|
||||
export type LaunchOptions = channels.BrowserTypeLaunchOptions & { useWebSocket?: boolean, ignoreChromiumSwitches?: boolean };
|
||||
|
||||
export type ProtocolLogger = (direction: 'send' | 'receive', message: object) => void;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user