Rayrun
โ† Back to Discord Forum

HI There,

devang_patelposted in #help-playwright
Open in Discord
devang_patel

I like to launch browser in maximised mode. I have tried following const context = await browser.newContext({ viewport: { width: 1920, height: 1080 }, deviceScaleFactor: 1, }); const page = await context.newPage(); It opens up browser in that size but top left corner is shifted by few pixels. Any help would be useful.

This thread is trying to answer question "How to launch a browser in maximised mode using Playwright without the top left corner being shifted?"

2 replies

Hey ๐Ÿ‘‹ ,

Does this work for you in playwright.config.js ?

{
      name: 'chromium',
      
      use: {  
        ...devices['Desktop Chromium'],
        viewport: null,
    
        launchOptions: {
          args: ["--start-maximized"]
      } 
      }, 
    },```
or using 
`--start-fullscreen` ?

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].