【问题标题】:How to enable chrome features from the command line?如何从命令行启用 chrome 功能?
【发布时间】:2020-01-13 21:24:40
【问题描述】:

我正在尝试对受 Chrome 对 SameSite cookie 属性的未决更改影响的单点登录过程进行测试修复(请参阅SameSite Updates)。

我可以在 chrome://flags 中启用这两个功能,以确保 chrome 呈现新的行为:

SameSiteByDefaultCookies
CookiesWithoutSameSiteMustBeSecure

上面的链接还提到了我还需要为我的测试设置的这个附加功能,以确保我的单点登录过程将继续适用于 chrome 81+:

SameSiteDefaultChecksMethodRigorously 

但是,chrome://flags 页面中不存在该功能。该链接建议我可以使用命令行选项启用它:

--enable-features=SameSiteDefaultChecksMethodRigorously

但是如果没有 chrome://flags 中显示的功能,很难说该功能 (a) 是否存在,以及 (b) 是否已设置。

我还尝试从命令行设置其他两个功能:

--enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure

同样,很难说这是否有效,因为这些功能在 chrome://flags 中仍显示为“默认”。

从 chrome://version 我可以看到完整的命令行,并且我的选项已放在 --flag-switches-begin 选项之前。所以我用这个命令行再次尝试:

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

chrome://version 现在将命令行显示为:

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

即正在添加第二对--flag-switches-begin --flag-switches-end。并且功能在 chrome://flags 中仍然设置为“默认”。

chrome://版本

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

有什么想法吗?

谢谢。

【问题讨论】:

  • Chrome/Chromium 将添加 --flag-switches-begin --flag-switches-end。如果您在不添加任何标志的情况下正常运行 Chrome,这些开关仍将通过,您可以在 chrome://version 页面中看到。 AFAIK,如果该页面中存在开关,则这些功能已启用。

标签: google-chrome chromium samesite


【解决方案1】:

--flag-switches-begin--flag-switches-end 不应从命令行手动添加。它们是根据chrome://flags 中的设置自动生成的。

你想要的

--enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure,SameSiteDefaultChecksMethodRigorously

【讨论】:

  • 这在命令行似乎不再起作用。 C:\PROGRA~2\Google\Chrome\Application\chrome.exe --enable-features=SameSiteByDefaultCookies 打开 chrome,但未启用标志。 chrome 是否弃用了该开关?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-10-09
  • 2014-05-22
  • 1970-01-01
  • 2015-09-15
  • 1970-01-01
  • 1970-01-01
  • 2015-01-29
相关资源
最近更新 更多