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?]

  • I guess you can minimize the application and stop Dock (killall -STOP Dock) which might "freeze" the window? Alternatively, you can make the application you are using always on top.
    – Joy Jin
    Jan 11, 2021 at 12:39
  • thanks for the good ideas @JoyJin, much appreciated! :-) I'm using several other applications though so I'd need to specify that several applications should always be on top, which is also a bit tricky... so I'll wait and see if someone has an idea for how to prevent Chrome from coming on top all the time.
    – ATJ
    Jan 11, 2021 at 16:33

1 Answer 1


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

  • (I realise this technically doesn't answer your question so would be better as a comment than an answer, but I don't have enough reps for that)
    – MDJ
    Jan 11, 2021 at 16:31
  • Thanks for pointing this out! I'd not thought of doing it that way. There's actually an answer on Stack Exchange about how to use a headless Chrome with Selenium in Python (stackoverflow.com/questions/16180428/…) which solves my immediate problem. I'll still leave the question open though, because it might also be useful to other people in other situations to know if there's a way to tell Mac OS not to bring a specific app to the front. I've upvoted your answer but I don't have enough rep yet so it's not visible.
    – ATJ
    Jan 11, 2021 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .