Hacker News new | ask | show | jobs
by uncircle 328 days ago
Web devs: please, PLEASE, learn the difference between History.pushState() and History.replaceState(). It's the latter you want. Please do not spam my browser history just because I have interacted with your app; it's rude.

https://developer.mozilla.org/en-US/docs/Web/API/History/rep...

4 comments

I get this issue on YouTube every time (well, other way). On mobile, go to front page, search, hit a search result. Go back and you're on the front page...

If Google can't get it right (or don't care to) I think it's a lost battle.

Confirmed. Massive annoyance with youtube on mobile.
THIS. My browser history just had 100 entries added to it. Now I gotta got delete them all.

Also, pretty cool app!

Why do you need to delete them?
Well, the whole API is bad and the name is wrong. It has nothing to do with history, because you can ever only manipulate the top entries. You don't get an array of objects or simply some kind of list of URLs/ strings, you have to know the specific API to do head of stack manipulation basically.

And no, this has nothing to do with security. The browser could easily filter the list for same origin even with the list/ array approach. People just need to invent things that could've been just another data structure perhaps with some kind of Compare And Swap wrapper for concurrency.

I have the opposite problem with twitch when raids happens. please for the love of god keep a history of who was the previous streamer.