0

What are the required options for launching google chrome headless from C#? These are the options I’ve got now:

        var options = new ChromeOptions();
        options.AddArgument("--headless");
        options.AddArgument("start-maximized");
        options.AddArgument("--disable-gpu");
        options.AddArgument("--disable-extensions");
        options.AddArgument("--window-size=1024,768");
        var driver = new ChromeDriver(options);
Matt W
  • 11,753
  • 25
  • 118
  • 215
  • Looks OK. Is something not working? You might want to add the window-size too, but otherwise, it looks good. – Erik A. Brandstadmoen Mar 18 '18 at 20:03
  • Added the window size option (I think?) What's not working is basically this error, so trying to figure the most appropriate way of running it: https://stackoverflow.com/questions/49307056/headless-chrome-not-working-as-advertised/49321840 – Matt W Mar 18 '18 at 20:07
  • So, is this a separate question? Why did you create a new question, when all the details are in the other question? It's difficult for others to know the context if you don't provide it in this question. Maybe it's better to keep the conversation in the other post, and clarify there, if it's not getting the answers you wished for? – Erik A. Brandstadmoen Mar 18 '18 at 20:18
  • Other than not getting any responses, I wanted to reframe the question differently, focussing on a new aspect. I'm not asking here for a solution to the old problem. – Matt W Mar 18 '18 at 20:27

1 Answers1

0

It would appear that when running headless chrome from, at least, inside Visual Studio the "no-sandbox" option is required.

options.AddArgument("no-sandbox");

Found by accident here: https://stackoverflow.com/a/39299877/71376

Matt W
  • 11,753
  • 25
  • 118
  • 215