0

使用 gapi 的共享功能时出错。

在 drive_sdk 中打开 Url:

http://docswriter.com/#/edit/ {ids}

该页面还在谷歌搜索控制台中验证为:

docswriter.com

js中的分享功能:

factory.share = function(fileid) {
        var appid = '***********'; //Using App ID from Drive UI Integration
        var init = function() {
            var s = new gapi.drive.share.ShareClient(appid);
            s.setItemIds([fileid]);
            s.showSettingsDialog();
        }
        gapi.load('drive-share', init);
    };

错误:

拒绝显示“ https://drive.google.com/sharing/share?id=10RAw2XV2n3qizC237Z_HoXcbeeWeuEDS …ient=postMessage&appId=***********&embedOrigin=http%3A%2F%2Fdocswriter.com”一个框架,因为它将“X-Frame-Options”设置为“SAMEORIGIN”。

4

1 回答 1

0

通过在清单文件中使用应用 id 制作chrome 网络商店列表来解决问题,如下所示:(app id as api_console_project_id)

{
  "name": "Docswriter",
  "description": "App to write documentation",
  "version": "0.0.0.2",
  "manifest_version": 2,
  "api_console_project_id" : "4********3",
  "icons": {
    "128": "icon_128.png"
  },
  "app": {
    "urls": [
      "http://docswriter.com/"
    ],
    "launch": {
      "web_url": "http://docswriter.com/"
    }
  }
}

然后,当我从 chrome 网上商店安装该应用程序时,它就可以工作了。

于 2015-08-16T12:48:22.380 回答