[openstreetmap/openstreetmap-website] Add reload on iframe redirect (PR #5823)

Martin Raifer notifications at github.com
Wed Apr 9 14:09:53 UTC 2025


@tyrasd commented on this pull request.



> @@ -36,4 +36,10 @@ $(function () {
   if (idData.gpx) params.set("gpx", idData.gpx);
 
   id.attr("src", idData.url + "#" + params);
+
+  id.ready(function () {
+    if (!this.contentWindow.location.href.startsWith(idData.url)) {

I get a `Uncaught TypeError: this.contentWindow is undefined` error every time I regularly start an iD editing session. Is that expected? Would it not be better to skip the check if everything is loaded correctly, maybe like this:

```js
if (this.contentWindow && !this.contentWindow.location.href.startsWith(idData.url)) {
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5823#pullrequestreview-2753636419
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5823/review/2753636419 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250409/295c4d31/attachment-0001.htm>


More information about the rails-dev mailing list