New issue
Advanced search Search tips

Issue 659946 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: 2017-01-01
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

In the first few of logs can't display from Service Worker's fetch listener

Reported by tsang...@gmail.com, Oct 27 2016

Issue description

Chrome Version       : 56.0.2889.0 (开发者内部版本) (64 位)
                       56.0.2901.0 (正式版本) canary (64 位)
                       54.0.2840.71 (正式版本) m (32 位)
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
         IE:

What steps will reproduce the problem?
(1)create a service worker.
(2)add fetch listener
(3)use console to output something,eg:event.request.url

What is the expected result?

  All logs display.

What happens instead?
  In the first few of log can't display

Please provide any additional information below. Attach a screenshot if
possible.

 

Comment 1 by tsang...@gmail.com, Oct 27 2016

//In the first few of logs can't be displayed.
self.addEventListener('fetch', function(event) { 
    console.log(event.request.url);
})


//all logs displayed
self.addEventListener('fetch', function(event) { 
    setTimeout(function(){
        console.log(event.request.url);
    },1000)
})

If set a setTimeout to run, all logs can be displayed.
Labels: TE-NeedsTriageHelp
Components: Blink>ServiceWorker
Labels: -TE-NeedsTriageHelp

Comment 5 by horo@chromium.org, Nov 4 2016

I think if you check the "preserve log" check box in the console tab, you will see the first request.

Comment 6 by tsang...@gmail.com, Nov 4 2016

yeah! all displayed after I check the "preserve log" check box.

Is this normal?

actually I don't want to preserve log
Cc: pfeldman@chromium.org
Components: Platform>DevTools
By default, the log is cleared on page reload/navigation, and the first fetch event for the navigation occurs before that. It does seem like surprising behavior.

pfeldman: Is this the desired behavior for some reason, or would you consider this a bug?

Comment 8 by falken@chromium.org, Nov 11 2016

Cc: -pfeldman@chromium.org
NextAction: 2017-01-01
Owner: pfeldman@chromium.org
Status: Assigned (was: Unconfirmed)
assign to pfeldman for triage
Status: WontFix (was: Assigned)
Good question! Seems like we want to keep this configurable and "Preserve log" is the answer here.

Sign in to add a comment