Closed Bug 1626826 Opened 5 years ago Closed 5 years ago

filterResponseData fails when a request has a response status code of 200 after redirect

Categories

(WebExtensions :: Request Handling, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1623921

People

(Reporter: kernp25, Unassigned)

References

Details

Attachments

(1 file)

1.58 KB, application/x-zip-compressed
Details
Attached file background.zip

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

  1. 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:

  1. Load add-on in about:debugging
  2. Open add-on console
  3. Click on the browser action icon from the add-on

Is this a new bug or a duplicate of Bug 1623921?

Flags: needinfo?(mixedpuppy)

It's likely fixed by Bug 1597159, Bug 1623921 has a patch which is just a test for redirect handling.

Depends on: 1597159
Flags: needinfo?(mixedpuppy)
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: