问题
I want to enable a flag (enable-token-binding) while launching chrome. I can do that using chrome://flags page. but for running tests I need to do it from command line.
I tried
chrome --enable-features=token-binding
chrome --enable-token-binding
None of them worked.
回答1:
Try --flag-switches-begin --enable-token-binding --flag-switches-end
.
The patter is --flag-switches
start and ends capping the flags. Then the names of the flags provided as the parameters within with --
prefixed to them.
回答2:
- go to chrome://version
- Find the command line arguments:
Command Line /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --enable-audio-service-sandbox --flag-switches-begin --enable-features=CookiesWithoutSameSiteMustBeSecure,SameSiteByDefaultCookies --flag-switches-end --enable-audio-service-sandbox
Run the above command with all the arguments and your chrome instance would have all the settings preset.
回答3:
Token Binding was removed in Chrome release 70
see https://www.chromestatus.com/feature/5097603234529280
mayankSinha's answer works for the flags he mentions. Note the changed naming convention though: "lower case split by -" convention gets changed to CamelCase.
i.e. same-site-by-default-cookies (as shown in chrome://flags) becomes SameSiteByDefaultCookies
来源:https://stackoverflow.com/questions/50916529/enable-chrome-flags-from-the-command-line