New issue
Advanced search Search tips

Issue 844669 link

Starred by 2 users

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

No final chrome.webRequest event for responses with redirect status and no location

Reported by mmcd...@gmail.com, May 18 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Steps to reproduce the problem:
1. Load a page that returns with a response status code indicating a redirect (e.g. 301) but the location header is not set, and the response includes valid html.  Basically, the page acts *exactly* like a normal page except the status code is a 301 instead of 200.  Chromium will load/render this page as if it returned 200.
2. In an extension, listen to all chrome.webRequest events

What is the expected behavior?
The standard webRequest events should fire (onBeforeRequest, onBeforeSendHeaders, onSendHeaders, onHeadersReceived, onResponseStarted) followed by either onCompleted or onErrorOccurred (I would prefer onCompleted, but there's also a strong argument for onErrorOccurred)

What went wrong?
onResponseStarted is the last event fired.  onCompleted and onErrorOccurred never fire.

Did this work before? N/A 

Chrome version: 66.0.3359.139  Channel: n/a
OS Version: OS X 10.13.3
Flash Version: 

http://fbictest.com/httpresponsecode.php?code=301&content=1 is a page that can be used to reproduce this issue.  I have reproduced it in mac chrome 66 and centos chromium 61.
 
Labels: Needs-Triage-M66
Cc: susan.boorgula@chromium.org
Labels: Triaged-ET Needs-Feedback
mmcduff@ Thanks for the issue.

Request you to provide the link/name of the extension where we can see all chrome.webRequest events, which will help in further triaging of the issue.

Thanks..
Cc: davidben@chromium.org
David: I can't recall, was this related to the sequencing issue you mentioned?
Components: -Platform>DevTools Platform>Extensions>API
I ran into a sequencing issue way back around HTTP auth. This looks different, but I'm not surprised their aren't other sequencing issues.
> their aren't
there are

That was an impressively badly typed sentence, even by my standards. :-)

Comment 7 by mmcd...@gmail.com, May 21 2018

Susan, something like the following in the background page should be able to reproduce this issue along with a webserver and url that exhibits the behavior specified in the original report:

['onBeforeRequest', 'onBeforeSendHeaders', 'onSendHeaders', 'onHeadersReceived', 'onAuthRequired', 'onBeforeRedirect', 'onResponseStarted', 'onCompleted', 'onErrorOccurred'].forEach(function(e) {
  chrome.webRequest[e].addListener(console.log);
});
Project Member

Comment 8 by sheriffbot@chromium.org, May 21 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
mmcduff@ Thanks for the update.

Tested this issue on Mac OS 10.13.3 on the reported version 66.0.3359.139 and the latest Canary 69.0.3444.0 by following the below steps.

1. Launched Chrome and navigated to http://fbictest.com/httpresponsecode.php?code=301&content=1.
2. Opened Devtools -> Console and executed ['onBeforeRequest', 'onBeforeSendHeaders', 'onSendHeaders', 'onHeadersReceived', 'onAuthRequired', 'onBeforeRedirect', 'onResponseStarted', 'onCompleted', 'onErrorOccurred'].forEach(function(e) {
  chrome.webRequest[e].addListener(console.log);
}); and can see Uncaught TypeError error.

Attached is the screen shot for reference.

Request you to provide a screen cast of the steps followed where the issue can be reproduced.

Thanks..
Screen Shot 2018-05-29 at 6.03.34 PM.png
184 KB View Download

Comment 10 by mmcd...@gmail.com, May 29 2018

That JavaScript needs to be run background page of an extension with the webRequest permission.  The error you encountered is expected if you try to run it in the JS environment of a webpage.
Project Member

Comment 11 by sheriffbot@chromium.org, May 29 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: phanindra.mandapaka@chromium.org
Labels: Needs-Feedback
Thanks for your response...

@Reporter:As per your comment #10 could you please provide extension url and requesting you to provide a screen cast of the steps followed where the issue can be reproduced. 

Comment 13 by mmcd...@gmail.com, Jun 19 2018

This isn't a published extension, so I can't provide a URL.  I'm not sure what a screencast would demonstrate that my repro instructions have not (do you want a screencast showing how to create a chromium extension?).  Have you tried running an extension with the webRequest permission that includes the provided javascript?
Project Member

Comment 14 by sheriffbot@chromium.org, Jun 19 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment