Google Chrome refused to display the GoogleMaps frame because X-Frame-Options is set to disable

I am working on a website for a store and I use GooleMaps Engine Lite to show its location. It works on IE9 and 10, Safari for Windows, iOS and MacOs, and Mozilla Firefox, but it does not work on Chrome. If I use the Javascript Console, I see the following error:

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'. 

Can someone help me?

+7
javascript google-chrome
source share
4 answers

The first time I had a problem with disappearance when I rebooted my computer, but today the problem reappeared. I read on the Google forums that a conflict occurs when you are partially registered with your Google account. If I completely log out of my account or log into the card, it will start working again. In Safari you will find the same problem.

The workaround is a map iframe sandbox to prevent it from accessing cookies.

+3
source share

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

The X-Frame-Options HTTP response header can be used to indicate whether the browser is allowed to display the page in <frame> or <iframe> . Sites can use this to avoid Clickjacking attacks, ensuring that their content is not embedded in other sites.

The counter-question I have for you is why do you implement this URL in an iframe when it specifically tells the browser that it doesn’t want to load into the iframe?

Did you follow the instructions https://support.google.com/mapsenginelite/answer/3024935?hl=en when attaching the map?

  • Make sure your open card is open and public.
  • Click the folder button.
  • Select "Paste" on my website.
  • In the window that appears, copy the HTML code into the "Paste into the Internet" field and paste it into the source code of your website or blog.
+2
source share

You are linking to a Google account login page for a map generator, not a map. Link is probably not what you want.

To create a nested map from Google Maps Engine,

  • click the green "Share" button in the upper right corner and configure the map for public viewing enter image description here
  • click the folder icon in the upper left corner (next to “Add layer”) and select “Paste to my site", enter image description here
0
source share

1) in the lower left corner click on 6 gears, “Share and Integrate Map”, 2) in the dialog box that opens, click on “integrate map” 3) you received an iframe string with the correct src.

0
source share

All Articles