If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Get message (email) URL from JavaScript drop event

UNCONFIRMED
Unassigned

Status

()

Core
Drag and Drop
UNCONFIRMED
5 years ago
5 years ago

People

(Reporter: Craig Francis, Unassigned)

Tracking

18 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

3.10 KB, application/octet-stream
Details
(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130116073211

Steps to reproduce:

With a simple (and very much abbreviated):

    element.addEventListener("drop", drop_handler, false);

    function drop_handler(e) {
        console.log(e.dataTransfer.getData('URL'));
    }

If I drag an email from OSX Mail into the drop target in Google Chrome, it will return the message URI:

    message:%3CAAAA1AA1-1A1A-11AA-A11A-A11111AA1111@example.com%3E

However this does not seem to work with Firefox 18.0.1

It's kind of implied on the MDN page:

https://developer.mozilla.org/en-US/docs/DragDrop/Drag_Operations#drop

But not sure if this is what it means by a "link".

It also doesn't seem to work with "text/uri-list" as the getData() type... likewise "text/x-moz-url", which I got from

    e.dataTransfer.types[0]


Actual results:

No data seems to be returned, other than the dataTransfer.types being set to an array with 1 element (text/x-moz-url)


Expected results:

event.dataTransfer.getData('URL') should return the link url
(Reporter)

Comment 1

5 years ago
Created attachment 708739 [details]
Example case in HTML/JS

Using an example from SitePoint.com,

See filedrag.js, lines 35 to 41.
Component: Untriaged → Drag and Drop
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.