lionleaf / dwitter

Social network for short js demos
https://www.dwitter.net
Apache License 2.0
763 stars 69 forks source link

added: open links in new tab - accidentally navigating away from current page is a pita! #526

Closed srmcgann closed 2 years ago

srmcgann commented 2 years ago

added: open links in new tab - accidentally navigating away from current page is a pita!

ThomasBrierley commented 2 years ago

Is this referring to losing changes to the textarea upon navigation?

Interestingly Firefox has saved me from this a number of times because it autofills previously changed fields based on history navigation... for a short time at least.

I'm wondering if we should implement something similar as a more general solution to this type of problem for all browsers. I'm imagining some combination of localStorage with history and dweet id to differentiate between windows into the same dweet... although that would not uniquely identify it since the only history property we can use is history.length i think. Maybe with a timestamp to limit how long until it's "forgotten" would minimise mix-ups, i.e so we try to only affect accidental navigation of any kind... assuming people hit back, do they?

Just an idea. I'm aware of feature creep, so we shouldn't implement it if it doesn't sound useful enough.

lionleaf commented 2 years ago

You could also lose your scroll location etc.

But I think a localstorage draft system could make sense. This is the closest issue I could find about it: https://github.com/lionleaf/dwitter/issues/407