Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable chrome features from the command line?

I am trying to test fixes to a single sign-on process that is affected by Chrome's pending changes to the SameSite cookie attribute (see SameSite Updates).

I can enable these two features in chrome://flags to ensure that chrome exhibits the new behaviour:

SameSiteByDefaultCookies
CookiesWithoutSameSiteMustBeSecure

The above link also mentions this additional feature that I also need to set for my tests, to ensure my single sign-on process will continue to work for chrome 81+:

SameSiteDefaultChecksMethodRigorously 

However, that feature isn't present in the chrome://flags page. The link suggests I can enable it with a command line option:

--enable-features=SameSiteDefaultChecksMethodRigorously

But without the feature showing in chrome://flags it's hard to say whether that feature (a) exists, and (b) has been set.

I also tried setting the other two features from the command line:

--enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure

Again, it's hard to say whether this has worked as the features still appear as 'Default' in chrome://flags.

From chrome://version I can see the full command line, and that my option has been placed before the --flag-switches-begin option. So I tried again with this command line:

--flag-switches-begin --enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure --flag-switches-end

chrome://version now shows the command line as:

--flag-switches-begin --enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure --flag-switches-end --flag-switches-begin --flag-switches-end --enable-audio-service-sandbox

I.e. something is adding a second pair of --flag-switches-begin --flag-switches-end. And the features remain set to 'Default' in chrome://flags.

chrome://version

80.0.3987.42 (Official Build) beta (64-bit) (cohort: Beta)
Revision    fef3617f1566dc6972bc613792b56edb25311554-refs/branch-heads/3987@{#436}

Any ideas?

Thanks.

like image 434
redcalx Avatar asked Jan 13 '20 21:01

redcalx


People also ask

How do I run Chrome from the command line?

Open Chrome Using Command PromptOpen Run by typing “Run” in the Windows 10 search bar and selecting the “Run” application. Here, type Chrome and then select the “OK” button. The web browser will now open.

Does Chrome have a command line?

If you are wondering "What is Crosh?," it's a built-in terminal that Chromebooks have. This terminal, known as the Chrome OS Developer Shell—or Crosh for short—lets you access a command-line interface that you can use to debug your machine, run tests, or just poke around for fun.


1 Answers

--flag-switches-begin and --flag-switches-end should not be manually added from the command line. They are automatically generated based on the settings in chrome://flags.

You want

--enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure,SameSiteDefaultChecksMethodRigorously
like image 145
chlily Avatar answered Oct 11 '22 20:10

chlily