webRequest.onBeforeRequest fires two different requestIds after redirect when network cache is filled
Categories
(WebExtensions :: Request Handling, defect, P2)
Tracking
(Not tracked)
People
(Reporter: mozilla+bugzilla, Assigned: MeFisto94)
References
Details
Attachments
(1 file)
(deleted),
application/x-zip-compressed
|
Details |
Updated•7 years ago
|
Updated•6 years ago
|
Comment 2•6 years ago
|
||
Updated•6 years ago
|
Tested with Firefox Developer Edition 66.0b10 (64-bit) on Linux and network.http.rcwn.enabled set to false. The issue is still present: after youtube.com redirects to www.youtube.com an additional onBeforeRequests with a new requestId is fired and the original request never fires onCompleted.
Hello,
I can confirm this bug is still present and it is breaking our web extension from working properly, whereas in Chrome it doesn't occur.
From what I have gathered so far, it seems to be a problem with those websites that redirect with 301 status codes rather than 307.
An example of a website with 307 redirection would be : http://www.badoo.com
An example of a website with 301 redirection would be : http://alibaba.ir
Youtube also uses 301 redirection, so it led me to believe that is the cause of the changing RequestId.
Can someone please confirm this? And if yes, can it be classified as a bug? Or is it by design?
Just to add. I tested it with the Disable Cache check-box marked in the Network tab of the Developers Tools.
Another related note: The extension broke even when the cache was empty. I use the web-ext module to debug my extension and it clears the cache every time it is run.
My observation was that onBeforeRequest event was raised with two different RequestIds of which the second one happens after the redirection made by the first request.
Assignee | ||
Comment 6•5 years ago
|
||
So according to recent testing this issue doesn't happen with nightly, but does so with all other releases (dev and beta).
Furthermore when using a self-compiled version based on an older commit, which happened before the current nightly was released, the issue is NOT present either.
So it seems there is some different side effect playing into this here. Can someone help testing and/or has a clue why this happens?
The attached zip contains a simple web extension to test it. Go to about:debugging
, install it and click on Inspect to open the Console.
Then browse to http://youtube.com
(no www no https) a few times and see if the IDs always match up.
Use the main_frame
filter in the console to not be spammed.
Note that this web extension will also put a red border around every webpage (borderify example), so that it's really clear whether the web extension is currently active or not.
Assignee | ||
Comment 7•5 years ago
|
||
Okay, using mozregression I was able to find the root of this problem or rather: where it has been fixed as "regression":
"Bug 1456995 (be9a6289)" did fix it and the reason we saw differences between nightly and beta is the presence of the pref dom.serviceWorkers.parent_intercept
which is only enabled on nightly currently.
So this is basically solved, the pref will be included as a result of Bug 1588154.
Assignee | ||
Comment 8•5 years ago
|
||
Closing as this issue is fixed as of Bug 1588154 and should land with Firefox 73.
Comment 14•3 years ago
|
||
Restrict comments here to prevent spam?
Comment 15•3 years ago
|
||
Thanks for the heads-up; done.
Description
•