Skip to content

Unclear whether document unloading should abort fetches #4489

Open
@domenic

Description

@domenic

Porting from https://www.w3.org/Bugs/Public/show_bug.cgi?id=27347. Related: #1334.

Currently https://html.spec.whatwg.org/#navigate step 9, after beforeunload says

Abort the active document of browsingContext.

which in turn leads to https://html.spec.whatwg.org/#abort-a-document which says

Cancel any instances of the fetch algorithm in the context of document, discarding any tasks queued for them, and discarding any further data received from the network for them. If this resulted in any instances of the fetch algorithm being canceled or any queued tasks or any network data getting discarded, then set document's salvageable state to false.

Per the Bugzilla bug, as of 2016:

In short with recent versions:
Chrome and IE would never abort fetches just because of a started navigation.
Safari would abort "normal" fetches (ajax, loading iframes...) but not websockets
Firefox would abort "normal" fetches (ajax, loading iframes) and also websocket but not in all cases.

For a more detailed report i would need to invest more time...

The bug filer also notes that it's pretty weird for us to abort documents if the navigation is being caused by a download. Maybe we'd want to cancel ongoing fetches after we've actually updated session history or something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions