Ingebedde Google Maps werkt niet meer

AI-generated summary

A user reported that embedded Google Maps stopped working on their Discourse forum, showing an empty iframe despite the link being valid and the embed working elsewhere. The issue was traced to the map URL containing /d/embed?, which wasn’t in the default allowed iframes list. supermathie confirmed that adding https://www.google.com/maps/d/embed? to the allowed list resolved the issue on try.discourse.org. Canapin noted that the embed worked again after rebaking posts, even though the URL was already allowed. Carl_Hashmi confirmed the same problem and workaround. The discussion concluded that while the /d/embed path should be considered for the default allowed list, it may not be necessary yet due to limited reports and the availability of a simple fix.

I embedded a map in a post by writing the link on a single line. It was working perfectly for days until it wasn’t… And I don’t know why.
The link is working, and the embedding of the same map works in my other Discourse.

It creates an empty iframe:


The iframe link is https://www.google.com/maps/d/embed?mid=1MisLV7Ag0x8vMU5dSww1uWnQQxVgzO8e.

I didn’t change any related setting and I still have https://www.google.com/maps/d/embed? in my allowed iframes.
No error in the js console, and nothing in logs. Safe-mode doesn’t fix the issue.

Any idea why the map doesn’t load anymore?

edit:
However, the iframe content is displayed if I directly paste this the iframe HTML code in my post. :thinking:

I pasted this link: https://www.google.com/maps/d/embed?mid=za0Bx0koO4sk.kHCbG4TApEP4
On a single line on my two Discourse forums.

It works on one of my forum, and here’s the cooked code:

<div class="maps-onebox">
<iframe src="https://www.google.com/maps/d/embed?mid=13xLbRXoFU-UIUoTiOwJdvLzkoUw" width="690" height="400" frameborder="0" style="border:0" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>
</div>

On the forum on which it doesn’t work, here’s the cooked:

<div class="maps-onebox">
<iframe width="690" height="400" frameborder="0" style="border:0" data-unsanitized-src="https://www.google.com/maps/d/embed?mid=za0Bx0koO4sk.kHCbG4TApEP4" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>
</div>

Note that there is a data-unsanitized-src attribute in the iframe on the forum where it doesn’t work.

Both forum are using 2.6.0.beta3 ( b8015ab654 )

And I can repro on try.discourse.org:

Note that the generated iframe also has a data-unsanitized-src attribute.

Have they changed their embed path? I note on try that the default allowed iframes has https://www.google.com/maps/embed? but not https://www.google.com/maps/d/embed?

I just added https://www.google.com/maps/d/embed? to the allowlist, rebaked the posts and they are now working on try.

I already had https://www.google.com/maps/d/embed? in my allowed iframes and it was working until today on my forum. :thinking:

edit: iframes now work on try.discourse. I supposed you added /d/embed on it @supermathie?

Anyway it’s still not working on my forum despite having this url allowed… :confused:

I rebaked my posts and it started work again. :+1:

And happy birthday.

Yep, see post above.

:+1:

Follow-up for us: Should we add this path to the default?

Not sure. Just tried to embed a Google Map and I got the URL without the /d/ :man_shrugging:

@Canapin how did you get that embed URL?

I got this map URL: https://www.google.com/maps/d/u/0/viewer?mid=1MisLV7Ag0x8vMU5dSww1uWnQQxVgzO8e&ll=30.174583250700085%2C-30.06865476191399&z=3 from https://sites.google.com/view/openunicyclecalendar/open-unicycle-map

It doesn’t work without the /d/, and clicking the hamburger → embed shares a link with the /d/ as well.

Thanks, looks like those are user-generated maps? Don’t know if those are popular enough to warrant it be a default :thinking:

Since we have a simple workaround, I’m going to give it the wait-till-we-have-3-reports to add that URL as a default.

Have the same problem, old maps are shown, new ones are not.
Don´t have access to our core so can´t rebake posts.

After adding /D/ to the list above I can now get link as iframe to work.. but not only as a “one row link”.

This is the issue I was facing and I already had /d/ in my iframe authorized URL, so I still don’t understand why it stopped working, and worked again later.
The only thing I did was to remove /d/ from the authorized URLs, and add it again… :man_shrugging:
(and I needed to rebake after anyway)