| ▲ | layer8 4 days ago |
| > Why not just use localStorage? So that I can operate two windows/tabs of the same site in parallel without them stealing each other’s scroll position. In addition, the second window/tab may have originated from duplicating the first one. |
|
| ▲ | mejutoco 4 days ago | parent | next [-] |
| You could work around that if needed with a unique id per tab (I was curious myself) https://stackoverflow.com/questions/11896160/any-way-to-iden... |
| |
| ▲ | layer8 4 days ago | parent [-] | | Yes, but how do you garbage-collect the stored per-tab state from the local storage? Note that it’s not just per tab, but per history entry of the tab. (When the user goes back, they want the respective state to be restored, and again when going forward in reverse.) Furthermore, with browser features like “reopen closed tab”. Better let the browser manage the state implicitly by managing the URLs. | | |
| ▲ | MattDaEskimo 4 days ago | parent [-] | | Scroll position is _kind of_ fine. Typically I can link the ID in the URL as "state". I was referring to mostly everything else |
|
|
|
| ▲ | phillipseamore 4 days ago | parent | prev [-] |
| sessionStorage should treat the windows/tabs as separate |