Unstable behavior when a page that transited during fetch is restored from bfcache
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
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:
- Setup reproduction code:
git clone https://github.com/mizdra/bfcache-and-page-transitions-during-fetching-testnpx serve .- Open http://localhost:3000/1-basic on Firefox
- Click "Fetch resource and transit to another page" button
- 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.
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
Comment 3•1 year ago
|
||
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.
| Reporter | ||
Comment 4•1 year ago
|
||
This issue has also been reported for Safari: https://bugs.webkit.org/show_bug.cgi?id=282506
Updated•1 year ago
|
Updated•1 year ago
|
Description
•