enable Chrome flags from the command line

荒凉一梦 提交于 2020-07-20 01:20:16

问题


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:


  1. go to chrome://version
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!