avalanche1
avalanche1

Reputation: 3592

Stop bringing Chromium to front

My tests run Puppeteer in headless: false mode and open several tabs.
If I am in another app window - whenever it opens a new tab - it focuses Chromium into view.
That is annoying. Is there any way to make it run in the background?

I'm on macOS 10.14

Upvotes: 6

Views: 3459

Answers (2)

mbit
mbit

Reputation: 3023

  1. Go to Chromium.app/Contents folder and open Info.plist in an editor.
    (for puppeteer it should be: node_modules/puppeteer/.local-chromium/mac-XXXXXX/chrome-mac/Chromium.app/Contents/Info.plist)
  2. After the first <dict> and before the <key> add the following:
    <key>LSBackgroundOnly</key>
    <string>True</string>
  1. Save and close it.

Now Chromium should run in the background and won't steal the focus.

Source: Keep applications from stealing focus when opening in OS X

Upvotes: 10

Peyter
Peyter

Reputation: 484

Depending on what you're doing with the Website, it looks like it may not be feasible:

https://github.com/puppeteer/puppeteer/issues/2656

Upvotes: 0

Related Questions