I'm having trouble with Gears file drag and drop in Firefox 3.5.  I'm
registering an event listener for the 'drop' event like so:


function handleFileDrop(evt) {

        if (evt.preventDefault) {
                evt.preventDefault();
        }

        var desktop = google.gears.factory.create("beta.desktop");
        var data = desktop.getDragData(evt, 'application/x-gears-files');
        var files = data && data.files;
        if (files) {
           // process files here
        }

        return false;
}

dropTarget.addEventListener('drop', handleFileDrop, false);


The event is fired and captured properly but the call to
desktop.getDragData() returns "The drag-and-drop event is invalid."

I've tested this on CentOS 5.3 and Windows XP with the same results.

Any ideas what might be going wrong?

Note: this code works with gears on Firefox 3.0.x when listening for
the 'dragdrop' event.  Also the script tag including gears_init.js is
in the body tag not the head.

Reply via email to