Open Bug 1677386 Opened 4 years ago Updated 4 years ago

document.referrer inside an iframe doesn't work

Categories

(Core :: DOM: Core & HTML, defect)

80 Branch
defect

Tracking

()

UNCONFIRMED

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

Using private browsing it works properly

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Hi Kevin, thank you for the report! Could you share your example that causes this issue? Thanks!

Flags: needinfo?(kevin)
Severity: -- → S3

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,

Flags: needinfo?(kevin)

Yes please, the URL is better than nothing! Assuming it's not private anyway, or that you can give us a guest login.

Flags: needinfo?(kevin)

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

  1. after login, and selecting an universe, the code opens an iframe to https://u9.owge.net/synchronice-credentials
  2. 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

Flags: needinfo?(kevin)
You need to log in before you can comment on or make changes to this bug.