Drag Drop Upload fixed for Gmail

My Drag Drop Upload extension for Firefox was having some troubles in providing the case of multiple file drop in a Gmail account because Gmail requires to use the "Attach another file" button. They are keeping an attachment counter so the technique of adding new input fields was not more working.

The new version 1.5.6 provides this functionality by simulating the click of the "Attach another file" link using this nice piece of code provided by one Googler for a Greasemoneky script:
function simulateClick(node) {
var event = node.ownerDocument.createEvent("MouseEvents");

event.initMouseEvent("click",
true, // can bubble
true, // cancellable
node.ownerDocument.defaultView,
1, // clicks
50, 50, // screen coordinates
50, 50, // client coordinates
false, false, false, false, // control/alt/shift/meta
0, // button,
node);

node.dispatchEvent(event);
}


Now it works. As usual you can grab it http://percro.sssup.it/~pit/mozilla/dragdropupload/
and in few days on Mozilla Update too.

Comments

dreadnaut said…
Hi! you just made another (lazy) person happy with this extension :-) Today I installed the Fizzle extension and I noticed DDU is not happy with non-standard pages or chrome - I get neverending TypeError exceptions, since the Fizzle page has no properties. A -try- missing somewhere ?
dreadnaut said…
easiest way to patch this: in dragdropupload.js add this line at the beginning of function getElementsByTagNameDeep (line 127): if (page == NULL) return [];
Fixed, thanks
Wolfgang Weber said…
Great little extension. Only problem (as has been noted before): Alt-L is not a good shortcut for opening the Drag Drop Sidebar, as it conflicts with Alt-L = the "at" sign on a German keyboard (see, there was no way I could type the sign here now). Could that be changed?

Popular posts from this blog

Docker for our ROS robotic overlords

cmakego: Simpler access to external libraries in CMake

Algebrical Data Types in C++