Open Bug 1928385 Opened 1 year ago Updated 1 year ago

Unstable behavior when a page that transited during fetch is restored from bfcache

Categories

(Core :: DOM: Navigation, defect)

Firefox 132
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mizdra, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Steps to reproduce:

  1. Setup reproduction code:
  • git clone https://github.com/mizdra/bfcache-and-page-transitions-during-fetching-test
  • npx serve .
  • Open http://localhost:3000/1-basic on Firefox
  1. Click "Fetch resource and transit to another page" button
  2. Click browser back button

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0

Actual results:

fetch is aborted and it throws a TypeError when the page is transited. http://localhost:3000/1-basic is restored from bfcache. The page is resumed from the point at which the TypeError was thrown.

However, there are several variations in the behavior after resumption: the textarea may display "Fetching..." in the textarea, and sometimes a TypeError is thrown. In some cases, nothing is displayed. In other words, the behavior after resuming is unstable.

Additional Context:
Many users do not expect the page to resume from the point at which fetch was aborted. Therefore, this behavior can break many pages. For more information, see the following.

Expected results:

I think there are two expected behaviors.

The first is to abort fetch on page transitions and not save the page as a bfcache. This avoids restoring the page from the point where the TypeError was thrown.

Second, do not abort fetch on page transitions, but save the page as a bfcache, so that fetch continues in the background. This avoids restoring the page from the point at which the TypeError was thrown. Moreover, the page is restored from the bfcache. This is the approach used by Chrome.

Attached video Capture (Part. 1)
Attached video Capture (Part. 2)

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Networking
Product: Firefox → Core

This issue has also been reported for Safari: https://bugs.webkit.org/show_bug.cgi?id=282506

Component: DOM: Networking → DOM: Navigation
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: