与Google按钮集成:无法在'DOMWindow'上执行'postMessage'

时间:2018-02-02 06:43:05

标签: gsuite

我正在尝试使用https://developers.google.com/gsuite/marketplace/button中的说明向我们的网站添加“与Google集成”按钮。

根据指示,我需要补充:

    <script type="text/javascript" src="https://apis.google.com/js/platform.js"/> 

领导然后合并:

   <g:additnow applicationid="[appid]"></g:additnow>

未呈现按钮。浏览器控制台中的错误说:

Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://accounts.google.com’) does not match the recipient window’s origin (‘http://server.local:8090’).

Load denied by X-Frame-Options: `
https://apis.google.com/additnow/additnow.html?usegapi=1&applicationid=[appid]&origin=http%3A%2F%2Fserver.local%3A8090&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.Vch8vd-lM6E.O%2Fm%3D__features__%2Fam%3DAQE%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCOgsbyjgLVijKgLfaXMbki4Pxbd_A#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Claunchurl&id=I0_1517552817258&_gfid=I0_1517552817258&parent=http%3A%2F%2Fserver.local%3A8090&pfname=&rpctoken=19038946
> does not permit cross-origin framing.

有几点:

  • 我正在使用Tomcat Web服务器加载页面
  • server.local解析为127.0.0.1
  • http禁用任何浏览器扩展程序
  • 该页面未加载到iframe中
  • 我尝试在没有https的情况下加载platform.js。没有区别。

有什么想法吗?

0 个答案:

没有答案