[openstreetmap-website] Fix "Report a problem" link in embedded map (#1136)

Florian Schäfer notifications at github.com
Fri Jan 15 21:21:38 UTC 2016


You can find a demo of the problem here: http://floscher.github.io/openstreetmap-website/demo.html
The first map is the current `embed.html`, the second map incorporates my proposed change.

Previously when you embedded a map with the HTML from the share-menu on http://osm.org, the link "Report a problem" was broken, because some browsers (at least Firefox 43 and Chromium 47) denied to open that link.

In Firefox the map is turning invisible and I get the following error message in the developer console:
```
Load denied by X-Frame-Options: http://www.openstreetmap.org/fixthemap?lat=0&lon=1.40625&zoom=0 does not permit cross-origin framing.
```

In Chromium simply nothing happens and the developer console shows:
```
Refused to display 'http://www.openstreetmap.org/fixthemap?lat=-1.1449996853268662e-13&lon=0&zoom=0' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
```

I fixed that problem by setting the attribute `target="_blank"` for that link, so it now opens in a new tab.

I also added the text of this link to the translatable strings.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/1136

-- Commit Summary --

  * When clicking "Report a problem" in an embedded map, open new tab/window
  * Make "Report a problem" link in embeddable map translateable

-- File Changes --

    M app/assets/javascripts/embed.js.erb (2)
    M config/locales/en.yml (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/1136.patch
https://github.com/openstreetmap/openstreetmap-website/pull/1136.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1136
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20160115/b971aece/attachment.html>


More information about the rails-dev mailing list