In general I think session restore is an area that could benefit from more spec attention. (E.g., it's not really specified that history.state should be restored by session restore, but many sites depend on it.) I think focusing on the needs of authors and measurement in this way is a great starting place.I can't think of anything that gives you the information passively. All I can think of depends on storing information and then seeing its status (e.g. history.state, sessionStorage, session cookies).Adding a new dedicated API might be a good path here. +Noam Rosenthal +Yoav Weiss probably have the most insight into where that would fit, in the performance API space.On Thu, May 12, 2022 at 6:12 PM Fergal Daly <fer...@google.com> wrote:I just triedperformance.getEntriesByType('navigation')[0].typeafter going back and then forward and then quit and restart chrome and the result is'back_forward'Is this WAI? I was kind-of expecting it to be 'reload'.
I think NotRestoredReason is the right place for this information.It seems clean to me that session-restore is aligned with regular non-cached history traversal as much as possible, which makes the fact that it's under-specified less painful.In that sense, I believe back_forward is a good enough navigation_type for session restore (in a way, you are going "back" to that page as in returning to it), and NotRestoredReason can perhaps divulge that this is a session-restore, though we should see if that's OK privacy-wise.
On Tue, 17 May 2022 at 16:21, Noam Rosenthal <noam.j.r...@gmail.com> wrote:I think NotRestoredReason is the right place for this information.It seems clean to me that session-restore is aligned with regular non-cached history traversal as much as possible, which makes the fact that it's under-specified less painful.In that sense, I believe back_forward is a good enough navigation_type for session restore (in a way, you are going "back" to that page as in returning to it), and NotRestoredReason can perhaps divulge that this is a session-restore, though we should see if that's OK privacy-wise.Whether this is a good or a bad thing, I don't know but exposing it as a NotRestoredReason would provide less information unless we had a specific reason for session-restore/clone. E.g. if the user gets to a.com via `navigate` and then clones then we could have a NotRestoresReason of `ineligible` but there's no way to know there was a session restore because the `navigate` made it ineligible. Is this a bug or a feature?
Check out https://groups.google.com/a/chromium.org/g/blink-dev/c/o0F7nBKsgg0/m/bJSp3ekfAAAJ , wherein Microsoft is proposing a new "useragent_launch" value for the type field that seems to have substantial overlap with this question. I think the bfcache team should engage with them and see if we can either use their proposal, or build on it.