You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught TypeError: Failed to construct 'Request': Referrer 'http://127.0.0.1:8000http://127.0.0.1:8000/4b78be26-cdf7-42a9-a59f-097945b09779' is not a valid URL.
at ajax.js:95
I only see this error when using dynamically generated iframe content.
This was working with mapbox-gl v0.50 and prior.
Thanks for reporting this issue. It looks like window.top.location works if the embedding document is loading the map document via a blob URL or data URL, but fails if it's loaded via a http URL that isn't the same origin as the embedding document.
Safari and Firefox have the same behavior. When a URL is loaded via blob URL, the pathname is the full blob URL (e.g. http://127.0.0.1:8000/4b78be26-cdf7-42a9-a59f-097945b09779), which doesn't seem sensible. Using window.top.location would fail if the embedded document was loaded from a different origin than the host document, so I think we'll need to detect blob/data URLs and only use window.top.location (or window.parent.location?) in that case.
Activity
kkaefer commentedon Mar 25, 2019
Thanks for reporting this issue. It looks like
window.top.locationworks if the embedding document is loading the map document via a blob URL or data URL, but fails if it's loaded via a http URL that isn't the same origin as the embedding document.Pessimistress commentedon Mar 26, 2019
I suspect this is a bug on Chrome's end. Though
window.location.pathname.startsWith(origin)should be sufficient to catch it?kkaefer commentedon Mar 26, 2019
Safari and Firefox have the same behavior. When a URL is loaded via blob URL, the pathname is the full blob URL (e.g.
http://127.0.0.1:8000/4b78be26-cdf7-42a9-a59f-097945b09779), which doesn't seem sensible. Usingwindow.top.locationwould fail if the embedded document was loaded from a different origin than the host document, so I think we'll need to detectblob/dataURLs and only usewindow.top.location(orwindow.parent.location?) in that case.kkaefer commentedon Aug 9, 2019
#8612 now uses the creating document's referrer in iframes loaded from a blob URL.