[Webkit-unassigned] [Bug 195145] [WK2] It should be possible to follow links with 'download' attributes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 4 10:25:34 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=195145

--- Comment #11 from David Quesada <david_quesada at apple.com> ---
(In reply to Darin Adler from comment #10)
> Comment on attachment 363307 [details]
> Patch
> 
> Adding a web preference does not seem like the best way to do this. We
> should consider other ways to keep old code compatible. Maybe a
> linked-on-or-after check? Maybe a new delegate method and leave the old one
> with the old meaning?
> 
> Long term we don’t want to have to set a preference to get this behavior. I
> think this new behavior would be a good new future default.

Based on your and Alex's feedback, I think a linked-on-or-after check is the way to go here. We could consider some other API to add, but I can't think of any* that fit in better than an out-of-the-way signal (e.g. a preference in this patch) that you want the new behavior, or nothing at all (linked-on-or-after check). I'll add a linked-on-or-after check.

Possible options might be:
- A new WKNavigationActionPolicy, e.g. _WKNavigationActionPolicyAllowIgnoringDownloadAttribute. Adding a new policy in this case seems unnecessary when we could just trust the navigation delegate to make the right decision given the knowledge that the website wants to download the link.
- A new WKNavigationDelegate method which is a copy of -decidePolicyForNavigationAction: but won't turn an 'Allow' into a 'Download'. This just feels wrong, since we're not asking the navigation delegate to do anything conceptually new, and encoding this change in behavior in the name (and preserving the old behavior for the existing method) seem really tedious. What would we call it: -webView:decidePolicyForNavigationActionAndIfYouTellUsToNavigateWeActuallyWill:decisionHandler? -webView:decidePolicyForNavigationActionV2:decisionHandler:?
- A new WKNavigationDelegate method which asks the delegate to confirm before converting a 'Use' into a 'Download'. This API would be weirdly redundant - "Hey navigation delegate, you knew the website wanted to download this file, but you told me to navigate to it. Are you sure about that, or should I download it anyway?"

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


More information about the webkit-unassigned mailing list