filterResponseData fails when a request has a response status code of 200 after redirect
Categories
(WebExtensions :: Request Handling, defect)
Tracking
(Not tracked)
People
(Reporter: kernp25, Unassigned)
References
Details
Attachments
(1 file)
1.58 KB,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
- Load add-on in about:debugging
Actual results:
It loads these urls:
https://mail.yahoo.com/ (302)
https://mail.yahoo.com/m/?.src=ym&reason=mobile (302)
https://mail.yahoo.com/mb/?.src=ym&reason=myc (200)
Doing webRequest.filterResponseData after the url has a status code of 200
will fail with the error: Channel redirected
Note: When using https://mail.yahoo.com/mb/ directly in the webRequest.RequestFilter urls array and loading https://mail.yahoo.com/mb/ directly, it will work as expected.
Expected results:
webRequest.filterResponseData should work after the url has a status code of 200.
The add-on does this:
if (details.statusCode == 200) {
let filter = browser.webRequest.filterResponseData(details.requestId);
filter.onerror = event => {
console.log(filter.error);
};
filter.ondata = event => {
filter.write(event.data);
console.log(event.data);
};
filter.onstop = event => {
filter.close();
};
}
var filter = {
urls: ["https://mail.yahoo.com/*"],
types: ["sub_frame"],
};
Here are the full STR:
- Load add-on in about:debugging
- Open add-on console
- Click on the browser action icon from the add-on
Is this a new bug or a duplicate of Bug 1623921?
Comment 5•5 years ago
|
||
It's likely fixed by Bug 1597159, Bug 1623921 has a patch which is just a test for redirect handling.
Updated•5 years ago
|
Description
•