LongPress->DownloadLink when started offline reverts to .html file download instead of producing Offline Page |
||||
Issue descriptionNormally, when user does LongPress->DownloadLink on a link that points to the HTML file (aka Web Page), the regular file download starts but after fetching the Content Type header it transfers the job to OfflinePages' RequestCoordinator to continue the full page load and offlining. However, if that was initiated when device was offline, the initial download/header sniff does not happen right away, instead the download gets paused and on network connection restore and resume it will not go to OfflinePages backend, finishing as a HTML file download. Expected: to transfer to OfflinePages backend regardless of how started.
,
Mar 22 2017
Issue 700028 has been merged into this issue.
,
Mar 24 2017
THis is where a file download is switched to an offline page download if the headers indicate it's "text/mhtml" resource: https://cs.chromium.org/chromium/src/chrome/browser/android/offline_pages/downloads/resource_throttle.cc?rcl=f09c3132dafcb61d0ad6b682468c178dace960eb&l=50 For some reason, throttling is not active when the download is woken up on network connect. Min, is this something you are familiar with?
,
Mar 31 2017
,
Apr 7 2017
BeginDownload (download_manager_impl.cc) may do the download in one of 2 different ways: 1) If there's a valid renderer process associated with the request, like in the case that selecting "Download Link" from a web page, ResourceDispatcherHostImpl will be invoked. We will have a chance to hook up offline_pages::downloads::ResourceThrottle to sniff the response MIME type and trigger the offline download if needed. 2) Otherwise, like in resuming the download from Downloads Home, UrlDownloader will be asked to do the download. There is not any hook to sniff the response.
,
Apr 7 2017
A possible fix to work for both flows is to rely on the interceptor. We've already attached DownloadRequestData to an URLRequst, but the logic to set and get these data are in DownloadRequestCore. So we need to expose a static method in DownloadRequestCore to determine if the URLRequst has the download data attached. We already get OfflinePageRequestInterceptor to override MaybeInterceptRequest to serve the offline pages. We just need it to also override MaybeInterceptResponse which will check if the request is a download request. If so, sniff the mime type to trigger the offline download. One UI note: currently we cancel the existing download and create a new offline download. If Downloads home is opened, you may see an existing download being removed and a new one being added.
,
Jun 2 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by dim...@chromium.org
, Mar 1 2017Status: Assigned (was: Untriaged)