【问题标题】:Unable to start chrome in non secure mode?无法在非安全模式下启动 chrome?
【发布时间】:2014-08-15 13:58:04
【问题描述】:

我正在尝试调试应用程序,但它引发了同源策略错误。

所以我跟着票 Disable same origin policy in Chrome

但是,当我从 cmd 使用 CC:\Program Files\Google\Chrome\Application\chrome.exe" --args --disable-web-security 启动 chrome 时,它​​不会以非安全模式启动,而是也不会显示 chrome 正在以非安全模式运行的通知。

我也为此禁用了所有扩展。

请帮忙。

【问题讨论】:

    标签: google-chrome google-chrome-extension


    【解决方案1】:

    删除--args,启动Chrome或Chromium如下:

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security
    

    这个标志非常危险,我建议启动一个单独的配置文件以避免将机密信息从一个网站泄露到另一个网站:

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%TMP%\profiledirname

    如果你想加载一个解压的扩展,使用--load-extension标志(可以通过逗号分隔路径来加载多个扩展):

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%TMP%\profiledirname --load-extension="C:\Users\My User\Documents\My extension"

    【讨论】:

    • 感谢 Rob 的回答,但是如果我可以添加一些内容:似乎在我的 Windows 版本中,有效的命令是:C:\"Program Files (x86)"\Google\Chrome \Application\chrome.exe --disable-web-security --user-data-dir=%TMP%\profiledirname (请注意“程序文件(x86)”周围的引号),没有引号,chrome要么不了解标志,否则不会启动。
    【解决方案2】:

    似乎不再支持--disable-web-security...

    Chromium 38 说(从西班牙语翻译)“--disable-web-security 选项不被接受,因为它会影响安全性和稳定性”:-(

    【讨论】:

    • --disable-web-security 仍在实施。仅显示该警告以使用户知道此危险标志已被激活。如果 Chrome 不支持它,或者标志未激活,则根本不会显示任何通知。实际警告是“您正在使用不受支持的命令行标志:--disable-web-security。稳定性和安全性将受到影响。”。
    • 你是绝对正确的@RobW。我切换到英语以查看该警告的原始措辞,并得出结论认为西班牙语翻译是废话且令人困惑:“您正在使用不受支持的命令行标志”与“No se admissione el indicador de línea de comandos”无关"
    • 我尝试了发布的答案,但没有一个有效。可能是因为我有 chrome 的防病毒保护扩展。必须安装 Chrome Canary 才能在非安全模式下运行。
    【解决方案3】:

    您不需要--args 来使用--disable-web-security,但似乎由于Chrome 38 即使启用该参数也不允许没有正确标头的CORS。

    见:https://code.google.com/p/chromium/issues/detail?id=392170

    【讨论】:

      猜你喜欢
      • 2016-02-18
      • 1970-01-01
      • 2021-09-10
      • 1970-01-01
      • 2020-12-30
      • 1970-01-01
      • 2013-06-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多