-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Current spec asks location.reload() to clobber initiator
https://html.spec.whatwg.org/multipage/history.html#dom-location-reload currently says "The source browsing context must be the browsing context being navigated"
https://html.spec.whatwg.org/multipage/browsing-the-web.html#source-browsing-context says "Navigation always involves source browsing context, which is the browsing context which was responsible for starting the navigation".
Problems caused by current spec / behavior
This behavior is responsible for the following security-related problems:
- https://crbug.com/699271#c8 - Referrer is not preserved (instead new, security-sensitive URL is used as a Referrer and forwarded to an attacker)
- https://crbug.com/968529#18 - SameSite cookies are unexpectedly missing when an error page reloads a failed navigation (no security problem other than hindering adoption of SameSite cookies)
Proposal
I propose that location.reload() should preserve the initiator (just like reloading via browser UI and just like history.back()).
toyoshim, cbornet, dmeremyanin and phil2phil