简体   繁体   English

谷歌浏览器拒绝显示GoogleMaps Frame,因为X-Frame-Options设置为拒绝

[英]Google Chrome refused to display GoogleMaps Frame because X-Frame-Options is set to deny

I'm working on a website for a shop and I'm using the GooleMaps Engine Lite to show his location. 我正在一个商店的网站上工作,我正在使用GooleMaps Engine Lite来显示他的位置。 It works on IE9 and 10, Safari for Windows, iOS and MacOs and Mozilla Firefox, but it's not working on Chrome. 它适用于IE9和10,Safari适用于Windows,iOS和MacO以及Mozilla Firefox,但它不适用于Chrome。 If I use the Javascript Console I can see the following error: 如果我使用Javascript控制台,我可以看到以下错误:

Refused to display 'https://accounts.google.com/ServiceLogin?service=mapsengine&passive=1209600…up=https://mapsengine.google.com/map/embed?mid%3DzehbkDaSW5QM.kyKZHGifzxMc' in a frame because it set 'X-Frame-Options' to 'DENY'.

Could anybody help me? 有人能帮助我吗?

First time I had the problem it disappeared when I rebooted my computer, but today the problem appeared again. 我第一次遇到问题,当我重新启动计算机时它就消失了,但今天又出现了问题。 I've read on Google forums that the conflict comes when you are semi-logged with your Google account. 我在Google论坛上看到,当您使用自己的Google帐户进行半登录时,就会发生冲突。 If I log out completely my account or log in the map re-starts to work. 如果我完全注销我的帐户或登录地图重新开始工作。 In Safari you will find the same issue. 在Safari中,您会发现同样的问题。

A temporary solution is sandbox the map iframe to forbid it to access the cookies. 临时解决方案是将地图iframe沙箱禁止访问Cookie。

https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame> or <iframe> . X-Frame-Options HTTP响应头可用于指示是否应允许浏览器在<frame><iframe>呈现页面。 Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. 站点可以通过确保其内容未嵌入到其他站点中来避免点击劫持攻击。

The counter-question I have to you is why are you implementing that URL in an iframe, when it specifically tells the browser it does not want to be loaded in an iframe? 我对你提出的反问题是,为什么你在iframe中实现该URL,当它明确告诉浏览器它不想在iframe中加载时?

Did you follow the instructions at https://support.google.com/mapsenginelite/answer/3024935?hl=en when embedding the map? 在嵌入地图时,您是否按照https://support.google.com/mapsenginelite/answer/3024935?hl=zh-CN上的说明进行操作?

  • Make sure you have your desired map open and that it is set to be accessible by the Public. 确保您打开了所需的地图,并将其设置为可由公众访问。
  • Click the folder button. 单击文件夹按钮。
  • Select Embed on my site. 选择嵌入我的网站。
  • In the box that appears, copy the HTML under 'Embed on the web,' and paste it into the source code of your website or blog. 在显示的框中,复制“嵌入网络”下的HTML,然后将其粘贴到您网站或博客的源代码中。

You're linking to the Google Account login page for the maps generator, not to a map. 您要链接到地图生成器的Google帐户登录页面,而不是地图。 The link is probably not what you want. 链接可能不是你想要的。

To make an embeddable map from Google Maps Engine, 要从Google Maps Engine制作可嵌入的地图,

  1. click on the green "Share" button on the top right and set you map to public 点击右上角的绿色“分享”按钮,将地图设置为公开 在此输入图像描述
  2. click on the folder icon on the top left (next to "Add layer") and choose "Embed on my site" 单击左上角的文件夹图标(“添加图层”旁边),然后选择“嵌入我的网站” 在此输入图像描述

1)在左下角点击6个齿轮,“共享和整合地图”2)在打开的对话框中按“整合地图”3)你得到了具有正确src的iframe线。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 Google 显示 iCal - 拒绝显示,因为 X-Frame-Options 设置为拒绝 - Displaying iCal through Google - Refused to display because X-Frame-Options is set to Deny 拒绝在框架中显示“URL”,因为它将“x-frame-options”设置为“拒绝”。 但我没有使用 iFrame - Refused to display 'URL' in a frame because it set 'x-frame-options' is set to 'deny'. But i am not using iFrame 拒绝在框架中显示,因为它在JavaScript中将“X-Frame-Options”设置为“DENY” - Refused to display in a frame because it set 'X-Frame-Options' to 'DENY' in JavaScript 拒绝在框架中显示Facebook URL,因为它将“ X-Frame-Options”设置为“拒绝” - Refused to display Facebook URL in a frame because it set 'X-Frame-Options' to 'deny' Facebook画布:拒绝在框架中显示应用程序,因为它将“ X-Frame-Options”设置为“ DENY” - Facebook canvas: Refused to display app in a frame because it set 'X-Frame-Options' to 'DENY' 拒绝在框架中显示&#39;,因为它将&#39;X-Frame-Options&#39;设置为&#39;DENY&#39;。 在通过jQuery加载jsp时 - Refused to display ' in a frame because it set 'X-Frame-Options' to 'DENY'. at loading jsp by jquery 拒绝显示框架,因为它在 android webview 中将 X-Frame-Options 设置为“DENY” - Refused to display a frame because it set X-Frame-Options to 'DENY in android webview 拒绝在框架中显示“https://example.tld/”,因为它将“X-Frame-Options”设置为“拒绝” - Refused to display 'https://example.tld/' in a frame because it set 'X-Frame-Options' to 'deny' 拒绝在框架中显示“https://www.facebook.com/”,因为它将“X-Frame-Options”设置为“拒绝” - Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'deny' 拒绝在框架中显示,因为它将“X-Frame-Options”设置为 DENY facebook fb.ui 共享方法 - Refused to display in a frame because it set 'X-Frame-Options' to DENY facebook fb.ui share method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM