3

I need to keep a browser running in the background for a specific issue but i have to hide it so the enduser should not see. I have tried electron, nwjs and carlo and ended up using puppeteer since none of the above was meeting my expectation. I need to run a specific chrome extension. I have completed everything but i can't find out how to hide the chronium. I have tried "--no-startup-window" argument for chromium and window doesn't show up but code get stuck at

await puppeteer.launch(options);

I have read through puppeteer api and look through chronium args but could not figure out. Is there a way to hide chronium but run it in the background?

Thank you for your help in advance.

Kaan Boz
  • 51
  • 1
  • 1
  • 8

1 Answers1

2

You probably would like to run Chromium in headless mode. For this you may use command line switch or launch options. More information on Getting Started with Headless Chrome is available at this article.

Starting headless:

chrome --headless

Using puppeteer launch options:

{
    "headless": true,
    "args": ["--fast-start", "--disable-extensions", "--no-sandbox"],
    "ignoreHTTPSErrors": true
}
Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
  • 1
    I can't run chrome in headless mode cause i want to load an extension. You can't load extensions in headless mode. "--disable-extensions" not working for me. – Kaan Boz Nov 27 '18 at 16:47
  • 1
    @KaanBoz In this case this is duplicate of [Is it possible to run Google Chrome in headless mode with extensions?](https://stackoverflow.com/questions/45372066/is-it-possible-to-run-google-chrome-in-headless-mode-with-extensions/45372648#45372648) – Slava Ivanov Nov 27 '18 at 16:54
  • It is a similiar issue but they want to run chrome in headless mode, i don't care about headless mode, i just want to hide it so the end user wont see. But i think it is not possible. I'll keep searching. – Kaan Boz Nov 28 '18 at 05:43
  • 1
    Is it possible to run in headful mode but keep browser minimized? Since the browser keeps jumping foreground, which hinders me from doing other things on my computer. – avocado Mar 08 '20 at 10:24
  • 1
    @avocado I am not sure. We never need it, so I never question myself. Would you mind to post this as the new question, somebody will help. Thanks. – Slava Ivanov Mar 09 '20 at 15:04