Fork me on GitHub
Aaron Decker11:05:30

Is there a current best practice for what to do with browser history if a user deep-links to a page? This is in the context of Reitit's frontend browser history integration. For example, suppose I had a todo app, where the first page in the normal workflow is a list of todo items, and the user would normally click on one of those to route to a second page to edit the todo item. What if the user skips the first page by deep-linking to a specific note? Is it better to: a) Recognize that deep-linking occured and then reconstruct the browser history based on what it would have been had they gone through the normal workflow? or b) Ignore the browser history and just push-state for all navigation events?


In general browser history rewriting for any reason is usually extremely unexpected behaviour from user’s perspective. So I’d say just push the whatever deep-linked page is shown to history and that’s it.


History rewriting is mostly done by malware and hijacker sites, and as such it can work as quite a deterrent as well; it is not what people expect legitimate sites to do.