api.History.back - Safari limitations
What information was incorrect, unhelpful, or incomplete?
Safari is shown as fully supporting History, including History.back.
What did you expect to see?
I would have liked to see a note that Safari limits at least some usages of History when it cannot trace them back directly enough to user action. I was unable to quickly find documentation from Safari about the specifics of these restrictions. I expected MDN to at least mention the existence and general nature of the limitations.
For an example of the general kind of note I expected, on there's this text on another page:
For security reasons the
Historyobject doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.
As an additional item, that note actually seems to counterfactually assert that the navigation methods work without security concerns.
Did you test this? If so, how?
I attempted to use back in an apparently too indirect manner and discovered the issue via testing in Safari. Internet searches appear to confirm that Safari intentionally ignores some invocations of navigation methods based on security grounds. I consulted MDN for the specifics of what was allowed, but I found no mention of the limitations.
MDN page report details
- Query:
api.History.back - MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/History/back
- Report started: 2021-08-02T13:51:30.338Z
@judemelancon Can you provide steps to reproduce the issue in Safari, and describe how other browsers behave? 🙏