【问题标题】:Chrome "protocols must match" error when running Google Cloud Endpoints web client on localhost在 localhost 上运行 Google Cloud Endpoints Web 客户端时出现 Chrome“协议必须匹配”错误
【发布时间】:2014-01-15 16:20:00
【问题描述】:

我使用grunt 在本地主机上为我的 Web 应用程序提供服务。当我在 index.html 页面上包含 <script src="https://apis.google.com/js/client.js?onload=init"></script> 时,控制台中出现以下错误:

阻止来自“https://accounts.google.com”的帧 访问来源为“http://127.0.0.1:9000”的框架。框架 请求访问具有“https”协议,被访问的帧 有一个“http”协议。协议必须匹配。

我无法在 https 上运行我的本地服务器。如何在本地运行我的 Web 应用程序?

【问题讨论】:

  • 使用标志 --disable-web-security 启动 Chrome。那应该可以完成这项工作。
  • 我试过"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security和"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --args --disable-web-security:同样的问题。
  • 当我在我的 Macbook 上尝试相同的操作时,它可以工作。在 Windows 7 上没有。两者都在 Chrome 中。
  • 在 Windows 7 上它可以在 Opera 中运行。

标签: javascript google-cloud-endpoints


【解决方案1】:

导致错误的是 Chrome 扩展程序 DoNotTrackMe。禁用扩展程序可以解决问题。

【讨论】:

    猜你喜欢
    • 2012-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-21
    • 1970-01-01
    • 2019-02-18
    • 1970-01-01
    相关资源
    最近更新 更多