MacOS – Stop application from coming on top

applicationsmacoswindow-manager

I'm doing some web development testing which requires me to run a script which generates a virtual browser window. Whilst the script is running, the script interacts with the browser window several times a second. Every time something happens on the browser window, it comes to the foreground, covering any other windows I have open at the time. This makes it pretty much impossible to do anything else whilst the script is running. Does anyone know of a way to tell the operating system not to bring a specific application to the front?

[I'm on a MacBook Air, and am using Chrome for testing websites. So my question is: is there a way to get Chrome not to cover other applications, even when something new happens to it?]

Best Answer

For some situations running Chrome in headless mode may be a workaround. In this mode, you don't see the Chrome window at all. See https://developers.google.com/web/updates/2017/04/headless-chrome for details