-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] args options ignored when launching firefox #910
Comments
The following snippet worked for me: const browser = await playwright['firefox'].launch({
headless: false,
// either pass as a=b or 'a', 'b', no spaces inside
args: ['-height=666', '-width=888'],
});
// you want to opt-out from the default 800/600 viewport.
const context = await browser.newContext({ viewport: null });
const page = await context.newPage(); Note that the actual outer height is going to be higher than what you specify due to the toolbar. Please feel free to reopen if that did not address your issue. |
@pavelfeldman : thank you very much for your fast answer 👍 It works for me also thanks to your snippet. Is there a similar snippet to be able to resize the webkit browser window? |
Resizing via Do you mind sharing more about your use case? |
Hi @pavelfeldman , As you may notice, I am currently developing a Fluent API around Playwright. In this API, I want to ensure that the browser window size is as near as possible to the physical size of the emulated device. For example, if I want to run a test by emulating an iPhone, I do not want to have a 'big' browser window with a 'small' active size in it (the viewport). When I open a browser in the real life, the viewport size seems to fit exactly the browser window size, so in headfull scenarios the viewport should always be set by default to null in Playwright. So in my opinion, viewport size should always be correlated to the browser window size and vice versa: setting up the viewport size, regardless of the opened browser window size, is only a way to overcome some display hardware limitation on CI environment. |
Context:
Code Snippet
Describe the bug
I expect that browser width and height to be the ones set in the options arg passed to the launch() method.
Works for chromium with the options set as
The text was updated successfully, but these errors were encountered: