Skip to content

location.reload() should preserve the initiator of the navigation #4852

@anforowicz

Description

@anforowicz

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()).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions