New issue
Advanced search Search tips

Issue 604533 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Sep 27
Cc:
Components:
EstimatedDays: ----
NextAction: 2019-01-07
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

Can't download VCF file from data URI in Chrome for iOS

Project Member Reported by juberti@chromium.org, Apr 18 2016

Issue description

Version: 49.0.2623.109 stable
OS: iOS

What steps will reproduce the problem?
(1) Go to https://jsfiddle.net/at0d2mfz/9/
(2) Click "click me"
(3) Observe nothing happens

What is the expected output?
Download starts with foo.vcf (works on Android, desktop)

What do you see instead?
Nothing


Please use labels and text to provide additional information.

 
Note that it works in Safari and iOS Safari.
Cc: justincohen@chromium.org
Labels: M-52
Owner: gch...@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 1 2016

Labels: -M-52 M-53 MovedFrom-52
Moving this nonessential bug to the next milestone.

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

Comment 4 by gch...@chromium.org, Jun 23 2016

This case does not trigger -[WKNavigationDelegate didFailProvisionalNavigation], so download manager is never triggered. 

Comment 5 by gch...@chromium.org, Jun 23 2016

Cc: eugene...@chromium.org
gchatz@, which callbacks are triggered? Should we file a radar for this?
juberti@, Safari uses private WKWebView API for downloads. That API is not available for chrome (radar://26818508).

Comment 7 by gch...@chromium.org, Jun 23 2016

The only callbacks triggered are:
decidePolicyForNavigationAction
decidePolicyForNavigationResponse

With other downloads, the flow is:
decidePolicyForNavigationAction
didStartProvisionalNavigation
decidePolicyForNavigationResponse
didFailProvisionalNavigation
OK. So this is essentially unfixable at this time?
This is unfixable for downloads from iframes (unless Apple fixes radar://26818508). We don't know if it is something that we can fix for downloads from the main frame, but we are looking into it.
Labels: -M-53
As an update, we may be able to fix this for iframes by restructuring the way we trigger the download manager. But, not in the near term, so removing the milestone. 
Labels: M-55
Downloading a format not supported by WKWebView from a data uri in the main frame is failing because the URLFetcher does not support data URIs. To fix, we will need to workaround URLFetcher. One possibility from a cursory review is the DataProtocolHandler in the net stack. 
gchatz@, this works on Desktop. Does it mean that they do not use URLFetcher for data URLs downloads? Would it be hard to change iOS implementation to follow desktop approach?
Correction: the reason why DownloadManager is failing while Desktop succeeds is not related to use of URLFetcher (which desktop happens not to use). The reason is that the download manager always will do a fetch for headers followed by a fetch for the response, even if the url is not http. So to fix, download manager will need to check if the scheme is a data uri, and if so, only do one fetch. 
Labels: -M-55 M-56
Components: UI>Browser>Downloads
Blockedon: 780646
Labels: -M-56
Cc: gch...@chromium.org
 Issue 673135  has been merged into this issue.
Blockedon: -780646
Blockedon: 791806
Owner: eugene...@chromium.org
Reassigning my bugs.
Owner: ----
Status: Available (was: Assigned)
Blockedon: -791806
Cc: -gch...@chromium.org
New Download Manager does not support data:// URLs, because NSURLSession does not support them. The fix will not be trivial
Project Member

Comment 23 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e6be128334edbfb4b51a4d0eb73fe388578f0be4

commit e6be128334edbfb4b51a4d0eb73fe388578f0be4
Author: Eugene But <eugenebut@chromium.org>
Date: Wed Sep 26 15:40:07 2018

Log text/vcard MIME type downloads.

This adds a new value to Download.IOSDownloadMimeType histogram.
text/vcard could be a common email attachment and this histogram will
allow to understand if Chrome should support "Add To Contacts" UI for
these downloads.

Bug:  604533 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I03f1a409f201e20dfa44b8c16677b24a439ec7a5
Reviewed-on: https://chromium-review.googlesource.com/1244076
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594325}
[modify] https://crrev.com/e6be128334edbfb4b51a4d0eb73fe388578f0be4/ios/chrome/browser/download/browser_download_service.h
[modify] https://crrev.com/e6be128334edbfb4b51a4d0eb73fe388578f0be4/ios/chrome/browser/download/browser_download_service.mm
[modify] https://crrev.com/e6be128334edbfb4b51a4d0eb73fe388578f0be4/tools/metrics/histograms/enums.xml

NextAction: 2019-01-07
Snoozing till January to look at Download.IOSDownloadMimeType metric for text/vcard. In the meanwhile we going to implement support for data: URLs and improve Open In... presentation, so VCF can be open via Address Book extension.
Project Member

Comment 25 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66265f84e4e76aa5db9a5fed90b1347cc04181e8

commit 66265f84e4e76aa5db9a5fed90b1347cc04181e8
Author: Eugene But <eugenebut@chromium.org>
Date: Wed Sep 26 16:48:00 2018

Support data: URLs in iOS Download Manager.

data: URLs can be used for Calendar events and Contacts. These URLs
are supported by Safari and Chrome on other platforms.

This change will regress crbug.com/712206 (which is a minor bug),
so CRWWebControllerDownloadTest.DataUrlResponse test was removed.

Also updated FakeDownloadTaskImplDelegate to set mock expectations
earlier, because CreateSession is now called much later to avoid
creating sessions for data:// URLs.

Bug: 712206, 666211,  604533 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Iddbd7b8e58b781c1d093e35539db8fe5ec8841c4
Reviewed-on: https://chromium-review.googlesource.com/1244976
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594346}
[modify] https://crrev.com/66265f84e4e76aa5db9a5fed90b1347cc04181e8/ios/web/download/download_task_impl.h
[modify] https://crrev.com/66265f84e4e76aa5db9a5fed90b1347cc04181e8/ios/web/download/download_task_impl.mm
[modify] https://crrev.com/66265f84e4e76aa5db9a5fed90b1347cc04181e8/ios/web/download/download_task_impl_unittest.mm
[modify] https://crrev.com/66265f84e4e76aa5db9a5fed90b1347cc04181e8/ios/web/web_state/ui/crw_web_controller.mm
[modify] https://crrev.com/66265f84e4e76aa5db9a5fed90b1347cc04181e8/ios/web/web_state/ui/crw_web_controller_unittest.mm

Project Member

Comment 26 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f9a21632ec9ee309b349aa75cab451283b129d8a

commit f9a21632ec9ee309b349aa75cab451283b129d8a
Author: Eugene But <eugenebut@chromium.org>
Date: Wed Sep 26 17:25:43 2018

Pass UTI to UIDocumentInteractionController in Download Manager.

This will allow to offer more extensions in Open In... dialog. F.e.
after this change Contacts extension will be offered for VCF files.

Uniform type identifiers (UTIs) provide a unified way to identify
data handled within the system, such as documents, pasteboard data,
and bundles:
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html

Bug:  604533 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I75a0864633023a1cd844582f08b5034bc447a65b
Reviewed-on: https://chromium-review.googlesource.com/1244606
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594367}
[modify] https://crrev.com/f9a21632ec9ee309b349aa75cab451283b129d8a/ios/chrome/browser/ui/download/download_manager_coordinator.mm
[modify] https://crrev.com/f9a21632ec9ee309b349aa75cab451283b129d8a/ios/chrome/browser/ui/download/download_manager_coordinator_unittest.mm
[modify] https://crrev.com/f9a21632ec9ee309b349aa75cab451283b129d8a/ios/chrome/test/fakes/fake_document_interaction_controller.h
[modify] https://crrev.com/f9a21632ec9ee309b349aa75cab451283b129d8a/ios/chrome/test/fakes/fake_document_interaction_controller.mm

Cc: -eugene...@chromium.org
Labels: M-71
Owner: eugene...@chromium.org
Status: Fixed (was: Available)
Marking this as fixed. It should be possible to open VCF file in Contacts app via Open In... menu in Chrome 71.
Status: Verified (was: Fixed)
Verified in iPhoneX, iPad Pro 10.5" with iOS12.
VCF files now shows Download Manager UI and able to download and save contacts.
Build: M71.0.3567.0 canary
The NextAction date has arrived: 2019-01-07
Chrome for iOS downloads very small number of VCF files, so there is no value in building UI that adds contact to systems's Address Book. Open In... support is sufficient.

Sign in to add a comment