【问题标题】:Google Picker setVisible throw "Incorrect origin value. " errorGoogle Picker setVisible 抛出“Incorrect origin value.”错误
【发布时间】:2021-10-26 21:42:46
【问题描述】:

我们已经使用相同的代码大约 2 年了,现在它不再允许选择器显示。我查看了Google Picker API Invalid origin,但似乎无法实际设置原始值。选择器初始化如下。

picker = new google.picker.PickerBuilder()
.addView(new google.picker.DocsUploadView().setIncludeFolders(true))
.setOAuthToken(token)
.setDeveloperKey(developerKey)
.setCallback(pickerCallback)
.setOrigin('https://docs.google.com')
.build();

完整的错误是

[Report Only] Refused to frame 'https://docs.google.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://docs.google.com".
3760914899-picker_modularized_opc.js:1112 Uncaught Error: Incorrect origin value. Please set it to - (window.location.protocol + '//' + window.location.host) of the top-most page
    at new KJ (3760914899-picker_modularized_opc.js:1112)
    at 3760914899-picker_modularized_opc.js:1115
    at HTMLDocument.<anonymous> (picker:61)
rpc.js?c=1&container=onepick:127 Invalid rpc message origin.  vs https://host45.mydomain.com

最后一行表明原点是空字符串或未定义。

【问题讨论】:

    标签: javascript google-picker


    【解决方案1】:

    在 Google 的问题跟踪器上报告了与您类似的问题:

    您可以去那里为问题加注星标以获取更新。

    到目前为止,似乎没有任何解释或解决方案。

    【讨论】:

      猜你喜欢
      • 2021-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      • 1970-01-01
      • 2020-11-18
      相关资源
      最近更新 更多