Re: [whatwg] Proposal: Allow disabling of default scroll restoration behavior

Hi Nils,

I am not advocating for breaking the back button but in fact the opposite.
The idea is to allow single-page applications that are creating new history
entries and for whom the automatic scroll restoration is *broken* (because
the page is being re-creating on popstate event) to be able to replace
user-agent's default scroll restoration with their own custom
implementation.

Note that in practice, major mobile optimized sites are implementing their
own scroll restoration via various ugly hacks because the user agent scroll
restoration is broken for them. In my proposal, I have listed a few of
these hacks (e.g., double scroll, inner scrolling div) and their negative
implications. Websites that are trying to provide good back button behavior
should not resort to hacks and suffer for it.

Also the proposal is backward compatible and opts for restoring scroll
position  by default so existing websites will continue to behave as before.

Majid

On Tue, Apr 7, 2015 at 1:50 PM Nils Dagsson Moskopp <
nils@dieweltistgarnichtso.net> wrote:

> Majid Valipour <majidvp@chromium.org> writes:
>
> > For example a news site may want to always send user to the page top
> where
> > top news are displayed regardless of where the user was before. This is
> > currently being achieved by resorting to workarounds such as setting body
> > size to 100% and using inner divs (e.g., CBC news
> > <http://www.cbc.ca/m/news/>).
>
> Note that many users consider breaking the back button an annoyance. I
> do not want “take me back where I came from” to suddenly mean “take me
> back where the site owner would like to me to get”. Especially with
> “social” news feeds, following a link and then not being able to get
> back to the position on the page you came from is very frustrating.
>
> --
> Nils Dagsson Moskopp // erlehmann
> <http://dieweltistgarnichtso.net>
>

Received on Tuesday, 7 April 2015 19:50:42 UTC