Hijacking history is a pattern used by malware and trying to stop it has broken some honest websites. This happened with Flash, with Java applets, with popups. It shouldn't be a surprise. As I see it, you're considering the malware an acceptable sacrifice for having SPAs work slightly better (for what you value as better and I don't).
Websites as apps will continue to work, they'll either lose this functionality or use normal links - the kind that are good enough for Facebook et al. Or for Hacker News.
>Are you saying SPA authors shouldn't expose URLs for different navigation paths to the browser? I think you would be surprised at all the places your browser experience breaks, like not being able to restore tabs, or copy links to interesting news stories.
No. All of these work with links. Aren't you trying to fit a SPA shaped piece in a website shaped hole?
Links force a reload of additional assets, break ongoing socket connections, and at minimum requires a re-rendering of the entire DOM, which is a waste for many navigation actions that still deserve their own URL. In particular, the many tcp handshakes necessary for a total page refreshes are expensive on mobile.
As a concrete exampke, rich news experiences that let you scroll through preloaded stories benefit a lot from not needing to re-render all of the surrounding layout when the content changes, and from assigning a different url to each story.
Btw, I never said this was worth the current trade-off with malicious sites, just that the history features were originally inspired and still used by honest sites. Fortunately we have better options than all or nothing; sounds like Chrome is implementing a heuristic that makes sure url history can only be updated in some proportion to human actions. Another option might be a whitelist check like "<site> would like to update your history".
Websites as apps will continue to work, they'll either lose this functionality or use normal links - the kind that are good enough for Facebook et al. Or for Hacker News.
>Are you saying SPA authors shouldn't expose URLs for different navigation paths to the browser? I think you would be surprised at all the places your browser experience breaks, like not being able to restore tabs, or copy links to interesting news stories.
No. All of these work with links. Aren't you trying to fit a SPA shaped piece in a website shaped hole?