[Webkit-unassigned] [Bug 158801] WKWebView should expose API for download of a file.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 17 15:22:21 PDT 2016


--- Comment #4 from Brady Eidson <beidson at apple.com> ---
(In reply to comment #3)
> You can reproduce this by logging into a cloud service (ex: GoogleDrive) in
> a WKWebView with the websiteDataStore configuration set to
> +nonPersistentDataStore.
> Or attempt to download a file which is directly linked to from a webpage
> instead of displaying it inside of the WKWebView. This type of webpage may
> be protected by HTTP Basic Authentication for example. (I can provide such a
> sample site if desired.)
> In order to download the file into the application, intercept the request in
> webView:decidePolicyForNavigationAction:decisionHandler:. I am attempting
> the file download using an NSURLSessionDownloadTask. Attempting to use this
> request to download the file outside of WKWebView fails.

So, to clarify:

- The user is browsing around in a WKWebView app.
- The user clicks on a link that the app would like to download instead of display in the WKWebView.
- The app denies the load in the policy handler, and then attempts to load the URL using an NSURLSessionDownloadTask inside the app process.
- That fails when the URL is protected by some sort of auth (cookie, http auth, ntlm, etc)

If my recounting of the above scenario is correct, then the reason it fails is because the browsing session (including cookies, credentials, etc) is held by the networking process, but since the app is trying the load inside the app process, the download doesn't go through.

Is my understanding correct?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160617/bae058ee/attachment-0001.html>

More information about the webkit-unassigned mailing list