webRequest.onResponseStarted doesn't fire for main_frame when navigating through browser history
Categories
(WebExtensions :: Request Handling, defect)
Tracking
(Not tracked)
People
(Reporter: mad1ost, Unassigned)
Details
Attachments
(1 file)
|
602 bytes,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
webRequest.onResponseStarted event doesn't fire for types 'main_frame' when moving through browser history (by pressing back and forward buttons)
Expected results:
I expect that the event to be fired for main_frame, but it only fires for a favicon requests (*.ico)
Comment 1•5 years ago
|
||
Hello,
In order to properly reproduce the issue and confirm your findings, could you please attach the extension you used to uncover this issue?
Thank you !
Comment 3•5 years ago
|
||
If the page is eligible, the page is frozen, and a navigationg between history entries would restore the previously frozen version of the page instead of triggering a new request. This feature is called the "bfcache" (for "Back-Forward Cache") and documented at https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching . It's not Firefox-only: https://developers.google.com/web/updates/2019/02/back-forward-cache
This is working as intended.
I can also confirm this. But if this is working as expected then this is not a bug.
But how to determine if the page was loaded from the bfcache or not? Which API should I use?
Comment 7•5 years ago
|
||
You probably want https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation anyway.
(In reply to Tomislav Jovanovic :zombie from comment #7)
You probably want https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation anyway.
Unfortunately webNavigation API doesn't answer this question. TransitionQualifier "forward_back" is presented even if the page was not loaded from the bfcache.
Comment 9•5 years ago
•
|
||
If you really want to know whether a page was restored from the bfcache opposed to a fresh load, then the pageshow event has a persisted property that tells whether the page load was fresh or restored from the bfcache - https://developer.mozilla.org/en-US/docs/Web/API/PageTransitionEvent/persisted
Description
•