> I assume that the second of these now does mean that we can avoid navigation from within beforeunload itself, right?
Yes, and we do. See nsDocShell::IsNavigationAllowed.
> we don't unload the current document (ie we don't hit the first cited condition) until we start getting a response for the initial navigation
That's correct. It has to be that way, because the response could be a type that we'd hand off to a helper app instead of handling internally, so we can't know whether we'll be unloading at all until we get the response headers.
I too would be interested in what other browsers do. Conceptually, treating "user-triggered" and "page just randomly did it" navigations differently makes sense to me.
> I assume that the second of these now does mean that we can avoid navigation from within beforeunload itself, right?
Yes, and we do. See nsDocShell: :IsNavigationAl lowed.
> we don't unload the current document (ie we don't hit the first cited condition) until we start getting a response for the initial navigation
That's correct. It has to be that way, because the response could be a type that we'd hand off to a helper app instead of handling internally, so we can't know whether we'll be unloading at all until we get the response headers.
I too would be interested in what other browsers do. Conceptually, treating "user-triggered" and "page just randomly did it" navigations differently makes sense to me.