W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2017

[whatwg] [ScrollRestoration] API to notify browser when page finished loading?

From: Johannes Spangenberg <johannes.spangenberg@hotmail.de>
Date: Fri, 18 Aug 2017 02:12:52 +0000
To: "whatwg@whatwg.org" <whatwg@whatwg.org>
Message-ID: <VI1PR08MB031847BE3C40E2E0A3F3FA5DE9800@VI1PR08MB0318.eurprd08.prod.outlook.com>
Hello,

I was not sure where to ask this question. However, this draft was referenced by Chrome and Mozilla. So, hopefully this is the right place. I can also create a GitHub Issue at https://github.com/majido/scroll-restoration-proposal/issues if you like.

Lets come to the question. If I understand the current draft correctly, it only allows disabling scroll restoration performed by the borwser. This means that applications still have to implement scroll restoration manually. Other persisted user state (like user input on input fields) seems not to be considered at all. Do I have understood it correctly?

If I have understood it correctly, I would like to know whether you have considered an alternative API as described in the following sentences. Basically, the problem seems to be that the browser does not know when the page finishes loading. Therefore, my suggestion would be to add an API to notify the browser when the page was loaded successfully. An example for such API would be a function like this:

delayStateRestoration(promise:Promise<void>) : void

Calling this function would only be allowed while handling popstate event or before initial loading of page has finished. Calling this function when the page has already been loaded does not make sense.

Yours faithfully,
Johannes Spangenberg
Received on Friday, 18 August 2017 02:13:20 UTC

This archive was generated by hypermail 2.3.1 : Friday, 18 August 2017 02:13:21 UTC