support proposed DownloadURL format string on DataTransfer object

NEW
Unassigned

Status

()

Core
Drag and Drop
7 years ago
2 years ago

People

(Reporter: alessandro.vescovi, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a4) Gecko/20100407 MozillaDeveloperPreview/3.7a4 GTB7.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a4) Gecko/20100407 MozillaDeveloperPreview/3.7a4 GTB7.1

gmail's drag and drop does not open the drop box

Reproducible: Always

Steps to Reproduce:
1.new mail in gmail
2.drag a file onto the new mail window
3.
--> Core::DOM

Jonas, do we know what's going on here? I'm also seeing reports that drag-and-drop *from* Gmail to the desktop doesn't work as it's supposed to according to:

http://gmailblog.blogspot.com/2010/08/drag-and-drop-attachments-to-save-them.html
Component: Shell Integration → DOM
Product: Firefox → Core
QA Contact: shell.integration → general

Updated

7 years ago
Component: DOM → Drag and Drop
QA Contact: general → drag-drop
I think this uses some chrome-specific (or webkit-specific) features. I don't think we have support for this at all.

Not sure if the blog post forgets to say that this only works in some browsers.
That would surprise me, and if it's the case, we should figure out why they chose not to use the File and Drag and Drop APIs.
HTML5 file drag-n-drop does not support dragging files out of the browser to the desktop AFAIK. Only from desktop to browser And within the browser.

I think the only thing a page caninitialy a DataTransfer object with is textual content, such as text and HTML.
Actually, so I don't think it supports dragging files within the browser either. Other than that we might treat grabbing an image in a page roughly as dragging it from the desktop.

Would be good to have Neil verify though. I might have missed some way for sure.

Comment 6

7 years ago
The default drag handler supports dragging an image and creating a file out of it. Other than that, content cannot create file drag data. In fact, a security exception will occur if an attempt is made to do so.

What chrome-specific apis are being used here?
I've heard that chrome supports some sort of "download_uri" attribute. Can't really find any information on it though.

Comment 8

7 years ago
Looks like it was added by https://bugs.webkit.org/show_bug.cgi?id=31090

Also, see http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-August/022118.html

dataTransfer.setData("DownloadURL", someURL) and someURL will be downloaded to a file when dropped.
I believe someone from Google may jump onto this bug, soon!
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: drag and drop in gmail does not work → support proposed DownloadURL format string on DataTransfer object

Comment 10

7 years ago
It is indeed done using what was proposed in that post from august 2009, with modifications brought out by the actual implementation. In dragstart, we add a DownloadURL transfer format to the DataTransfer object in the event. The value is a string with colon-separated components: mime-type:filename:url

It doesn't, unfortunately, act fully like a file (e.g. you can't drag an attachment from a conversation to a compose, though we're hoping to be able to use a custom data format to include the message id and attachment id, and thereby avoid downloading and re-uploading the attachment, so if you can support application-defined transfer formats, we could use that), but it does act enough like a file for dragging things out to file managers and desktops on win/mac/linux.
Here is a good explanation of how it works :
http://www.thecssninja.com/javascript/gmail-dragout along with a simpler example than gmail.

Comment 12

6 years ago
hello, 
is there some progress here?
No.  If there were, it would be in this bug.
Tom, given your recent awesome work on the download API, is this something you have the relevant knowledge to implement easily? Looks like it basically involves supporting the download_uri attribute, which would let people drag attachments from gmail into the OS file manager. A friend of mine says this is the main thing keeping him on Chrome.
Blocks: 819373
You need to log in before you can comment on or make changes to this bug.