document referrer is always empty if page is served from SW
Categories
(Core :: DOM: Service Workers, defect, P3)
Tracking
()
People
(Reporter: version.ru, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Steps to reproduce:
- Open https://17ggvi.csb.app/foo/index.html page
- Reload page in order to activate SW (ServiceWorker)
- Click to "5. away" link
- Click to "1. foo" link
- Evaluate "document.referrer" in the developer console. It will be empty.
Navigation request to page should be served via SW, it's important for reproducing this bug.
Actual results:
document.referrer is empty
Expected results:
document.referrer is not empty
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
Thank you for providing a reproduction! Notes for future investigation to start from:
- The ServiceWorker https://17ggvi.csb.app/bar/sw.js is using workbox
- In general it looks like workbox should be performing a pass-through fetch of the form
fetch(request, undefined)
but that was just the first use of fetch I found. - This matters because step 13.1 of the Request constructor will clobber the referrer if init is not empty and our code conforms to this behavior
if (aInit.IsAnyMemberPresent()) {
request->SetReferrer(
NS_LITERAL_STRING_FROM_CSTRING(kFETCH_CLIENT_REFERRER_STR));
request->SetReferrerPolicy(ReferrerPolicy::_empty);
}
Updated•2 years ago
|
Comment 4•2 years ago
|
||
I am writing to follow up on this open bug report as it continues to significantly impact our company’s work. Specifically, one of our customers relies on the document.referrer value to be set when navigating to subpages. However, when requests go through our service worker, this property is always empty, causing issues on our customer’s website.
We would greatly appreciate any assistance in resolving this issue as soon as possible.
Updated•2 years ago
|
Updated•1 years ago
|
Description
•