Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • http://wiki.whatwg.org/wiki/DragAndDropEntries#DataTransferItem.getAsEntry.28.29
  • http://updates.html5rocks.com/2012/07/Drag-and-drop-a-folder-onto-Chrome-now-available
  • http://blog.protonet.info/post/26894439416/html5-drag-drop-files-and-folders
like image 404
BrianFreud Avatar asked Jul 23 '12 21:07

BrianFreud


1 Answers

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

like image 61
bokonic Avatar answered Nov 02 '22 04:11

bokonic