【问题标题】:The target origin provided ('https://docs.google.com') does not match the recipient window's origin ('http://localhost:3000')提供的目标来源 ('https://docs.google.com') 与收件人窗口的来源 ('http://localhost:3000') 不匹配
【发布时间】:2020-04-16 12:46:20
【问题描述】:

您好,我正在尝试从我的 react 应用程序访问 google drive,当我登录时,会出现 iframe 并显示“开发人员密钥无效”。我正在使用谷歌驱动库react-google-picker

我在浏览器控制台中收到类似 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin ('http://localhost:3000') 的消息。

我不明白为什么它说The target origin provided ('https://docs.google.com'),我在谷歌开发者控制台中输入http://localhost:3000 作为Javascript 原始网址。是 iframe 的问题吗?

【问题讨论】:

    标签: reactjs iframe google-drive-api google-drive-picker


    【解决方案1】:

    我在遇到同样问题时遇到了这个问题,尽管我是直接使用文档中的示例!

    我发现我错过了启用 Picker API https://console.cloud.google.com/apis/library/picker.googleapis.com

    【讨论】:

      猜你喜欢
      • 2020-02-03
      • 2021-05-26
      • 1970-01-01
      • 2018-12-02
      • 2019-05-25
      • 2019-12-30
      • 2018-01-15
      • 1970-01-01
      • 2019-04-04
      相关资源
      最近更新 更多