document.referrer inside an iframe doesn't work
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: kevin, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
Steps to reproduce:
Create a web application that has an iframe, whose Iframe will load its content using the service worker
Actual results:
The code inside the iframe is not able to access document.referrer, it's empty
Expected results:
Been able to access document.referrer, to retrieve the parent's origin, this is working fine in Chrome, Edge
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 3•4 years ago
|
||
Hi Kevin, thank you for the report! Could you share your example that causes this issue? Thanks!
Updated•4 years ago
|
Hello , due to the nature of the bug , would take some time to create an easy to reuse example, I can give an URL, that reproduces the problem.
If it's not enough, I would create an example project, with an iframe running in a service worker, and a regular page, but that would be the saturday,
Comment 5•4 years ago
|
||
Yes please, the URL is better than nothing! Assuming it's not private anyway, or that you can give us a guest login.
Yes, it's way faster as is an opensource project.
The production url is owge.net , a login test user can be nickname: "paco" and password "1234" without quotes.
Background information
- after login, and selecting an universe, the code opens an iframe to https://u9.owge.net/synchronice-credentials
- The iframe reads the
document.referrer
to check if it's a valid parent domain
Expected behavior after 2 would be document.referrer
to contain the parent window.
If I open it in private browsing it works, unless I logout to owge.net and start the process again. If I close the private browsing, and open it again it works.
If I delete all cache the first time it works, seems to be something with the way Firefox handles offline stored copy of the content in the Iframe, looks like when cached, it can't access the document.referrer. This works in Safari, and all those Chromium children
Thanks in advanced, I really wanted to provide short able to reproduce example, but have no time, srry
Description
•