Skip to content

[Question] How to disable bringing page to front during launching. #4822

@shirshak55

Description

@shirshak55

Its Headful mode.

Currently I am doing web chat tests where I would like to test multiple context.

If I spawn new context it brings that page to front loosing the focus.

let browser = await firefox.launch()

// Every 1 minute open new context and open page just to test if chat shows history or not.
while(true) {
  let context = await browser.newContext()
  let page = await context.newPage();
  
  // delay code is there not shown here.

}

The issue is that newContext spawns a new window which has focus or something is in page that is calling page.bringToFront() when its launched.

Questions:

  1. I would like to disable these behavior. If possible please let me know.
  2. Is there anyway to minimize the context window after launch. If I need to bring page to front I think i can call page.bringToFront() at the moment.

Its not a new issue I think and there are no answers available afaik.
puppeteer/puppeteer#5484
https://stackoverflow.com/questions/53501564/hide-browser-in-puppeteer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions