Fixes #491 When `--start-maximized` or `--window-size` is passed as a browser arg, Playwright's default viewport (1280x720) overrides the browser's own window sizing, making those flags have no effect on the page content. This change auto-detects those args and sets `viewport: null` so Playwright defers to the browser's window size. Explicit viewport values still take priority. Also allows `viewport: null` in the launch protocol for agents that want to disable viewport emulation directly.
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ export interface BaseCommand {
|
||||
export interface LaunchCommand extends BaseCommand {
|
||||
action: 'launch';
|
||||
headless?: boolean;
|
||||
viewport?: { width: number; height: number };
|
||||
viewport?: { width: number; height: number } | null;
|
||||
browser?: 'chromium' | 'firefox' | 'webkit';
|
||||
headers?: Record<string, string>;
|
||||
executablePath?: string;
|
||||
@@ -850,7 +850,7 @@ export interface TabCloseCommand extends BaseCommand {
|
||||
|
||||
export interface WindowNewCommand extends BaseCommand {
|
||||
action: 'window_new';
|
||||
viewport?: { width: number; height: number };
|
||||
viewport?: { width: number; height: number } | null;
|
||||
}
|
||||
|
||||
// Union of all command types
|
||||
|
||||
Reference in New Issue
Block a user