Bug 172678 - Support a way to provide a suggested filename for <img src="data:..."> file creation (drag to desktop, save as context menu)
Summary: Support a way to provide a suggested filename for <img src="data:..."> file c...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-05-26 21:35 PDT by Joseph Pecoraro
Modified: 2017-05-30 17:37 PDT (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (5.47 KB, patch)
2017-05-26 21:47 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-05-26 21:35:52 PDT
Summary:
Support a way to provide a suggested filename for <img src="data:..."> file creation (drag to desktop, save as context menu).

Test:
<img src="data:image/png;base64,...">

Existing Behavior:
• When dragging to Desktop => "Unknown.png"
• Right click > Save Image as => "Unknown.png"

Expected:
Web authors should be able to provide a suggested filename. For example:
<img src="data:image/png;base64,..." filename="dog.png">

Notes:
• This is somewhat related to Chrome's non-standard "DownloadURL" support. However that is only for Drag and Drop (not Save as) and requires JavaScript so won't work in some contexts.
Comment 1 Joseph Pecoraro 2017-05-26 21:38:02 PDT
I'd like to propose a "filename" attribute on <img> for this purpose. Similar to the "download" attribute on <a> but because this doesn't affect behavior of the <img>; its just about a suggested filename.
Comment 2 Radar WebKit Bug Importer 2017-05-26 21:38:18 PDT
<rdar://problem/32439969>
Comment 3 Joseph Pecoraro 2017-05-26 21:47:14 PDT
Created attachment 311409 [details]
[PATCH] Proposed Fix
Comment 4 Joseph Pecoraro 2017-05-30 17:37:06 PDT
I opened an HTML Spec issue:
<https://github.com/whatwg/html/issues/2722>