Below code open Chrome in non maximised state. I can see the code online/youtube used in Java to change the screensize but not found anything for c#.
public async Task Test1()
{
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{
Headless = false,
});
var context = await browser.NewContextAsync();
// Open new page
var page = await context.NewPageAsync();
await page.GotoAsync("https://google.com/");
}
To start the browser maximized, you need to pass
nullinstead of width & height.I don't have .NET installed, but it should be something like