Headless Chrome --user-data-dir and incognito mode

1,723 views
Skip to first unread message

Serge Konov

unread,
Jul 21, 2017, 10:20:45 AM7/21/17
to headless-dev
I'm trying to start Chrome in --headless with defined --user-data-dir switch.

As far as I can understand from the sources, although headless Chrome by default should start in incognito mode, it's disabled when the user-data-dir flag exists:

// Run a browser context in an incognito mode. Enabled by default.
 
bool incognito_mode;

if (command_line.HasSwitch(switches::kUserDataDir)) {
    builder
.SetUserDataDir(
        command_line
.GetSwitchValuePath(switches::kUserDataDir));
    builder
.SetIncognitoMode(false);
 
}

But it seems that regardless to that flag no profile data is written to the directory (but the directory is created), very similar to how it behaves in incognito mode.

Alex Clarke

unread,
Jul 21, 2017, 10:24:33 AM7/21/17
to Serge Konov, headless-dev
Sounds like a bug.  I've filed https://bugs.chromium.org/p/chromium/issues/detail?id=747394 to track it.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/69dc1679-8a9f-4bfc-89a9-4d8be6b65cf7%40chromium.org.

Serge Konov

unread,
Jul 21, 2017, 12:13:03 PM7/21/17
to headless-dev
That bug was merged as duplicate to https://bugs.chromium.org/p/chromium/issues/detail?id=617931#c9

But I suppose that these issues are not the same.

Eric Seckler

unread,
Jul 21, 2017, 12:16:54 PM7/21/17
to Serge Konov, headless-dev
Using --user-data-dir with the incognito profile is not supported as the incognito profile is stored only temporarily in-memory. The issue that no profile data is saved even though --user-data-dir is specified is mentioned in the bug I merged this one into.

On Fri, Jul 21, 2017, 17:13 Serge Konov <say...@saylas.ru> wrote:
That bug was merged as duplicate to https://bugs.chromium.org/p/chromium/issues/detail?id=617931#c9

But I suppose that these issues are not the same.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.

To post to this group, send email to headle...@chromium.org.
Reply all
Reply to author
Forward
0 new messages