BrianFreud
BrianFreud

Reputation: 7454

Is there a mozilla equivalent to webkitGetAsEntry?

Now that webkitGetAsEntry() has been activated on Chrome 21 to allow folder drag&drop, is there an equivalent in mozilla - mozGetAsEntry(), getAsEntry(), or something else? I've only been able to find very minimal info on webkit's method and the whatwg proposal; I can find nothing for Firefox (or any other browsers).

References:

Upvotes: 7

Views: 3895

Answers (1)

bokonic
bokonic

Reputation: 1771

What you're looking for is the mozGetDataAt() method, which returns an nsIFile object:

https://developer.mozilla.org/En/DragDrop/Recommended_Drag_Types#file

So to answer your question, the equivalent would be:

mozEntry = event.dataTransfer.mozGetDataAt(0);

or..

event.dataTransfer.mozGetDataAt(0).isFile() etc.

Documentation for nsIFile(contains the fields that are in the webkit entries): https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIFile

Upvotes: 1

Related Questions