DevTools offline and clear cache not working with service worker in Headless Chrome
Reported by
asa.kus...@gmail.com,
Jun 12 2018
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36 Steps to reproduce the problem: Detailed steps in github repo README: https://github.com/asakusuma/headless-chrome-sw-issues Reproduction screencast: https://www.youtube.com/watch?v=CsPJVHv2vaw tl;dr: Turn on offline mode, clear the cache, and fetch requests from the service worker still somehow succeeds. What is the expected behavior? Fetch request from service worker should fail when in offline mode after the cache is cleared. What went wrong? Given a simple service worker that simply forwards a fetch request, the fetch from the service worker somehow succeeds. Clearing the cache doesn't seem to be respected. Did this work before? N/A Chrome version: 67.0.3396.79 Channel: n/a OS Version: OS X 10.13.4 Flash Version: We discovered this issue while building some service worker tests, instrumented with the Chrome DevTools Protocol
,
Jun 12 2018
Also forgot to mention that this issue only seems to happen in headless chrome
,
Jun 13 2018
,
Jun 13 2018
Unable to test this issue on reported version 67.0.3359.79 and latest canary 69.0.3457.0 using steps mentioned in https://github.com/asakusuma/headless-chrome-sw-issues. i.e: On using chrome-canary --headless --remote-debugging-port=9200 in another terminal chrome build is not launching. Attaching screenshot and screencast for reference. @Reporter: Please check the screencast and let us know if we miss anything. Any further information on reproducing the issue would help in further triaging of the issue. Thanks!
,
Jun 13 2018
,
Jun 13 2018
,
Jun 13 2018
@sindhu.chelamcherla thanks for the response. I don't see any interaction with the browser of devTools in the screencast, which is necessary to reproduce. Also, the issue is intermittent. So you may need to try it several times to reproduce.
,
Jun 13 2018
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
,
Jun 13 2018
https://danishled.com/debug/ an example on my personal server reduced to the bare minimum of code. After some more playing the problem is temperamental ie sometimes it works correctly but if the view-source shows the original 'online' page then devtools will ignore the offline setting. This is duplicated comment and files from merged report.
,
Jun 15 2018
+horo@, he might have some insights about this.
,
Jun 15 2018
+cc:caseq@ I think this is because headless Chrome doesn't support network throttling. HeadlessNetworkDelegate::OnBeforeURLRequest() just removes "X-DevTools-Emulate-Network-Conditions-Client-Id" header. https://chromium.googlesource.com/chromium/src/+/09a224099edfb634fee46a3871e42428c56c4665/headless/lib/browser/headless_network_delegate.cc#46
,
Jun 20 2018
Why wouldn't headless chrome support network throttling? And if it doesn't support network throttling, then why would the issue be intermittent? The throttling appears to work sometimes, but not always.
,
Jun 27 2018
,
Jan 9
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by asa.kus...@gmail.com
, Jun 12 2018