else this.customDropHandlers.shift(obj);
This line will *remove* an event listener from the list of handlers. I
believe the intent was to *add* an event listener. So the line should
be:
else this.customDropHandlers.unshift(obj);
Javascript is rather unintuitive here, since you would expect "shift"
to just move something over, and "unshift" to take something off.
You could add a drop handler without specifying "in front", but then
your custom code would never get run if there's any other handler able
to handle that file type ahead of yours.
I wonder if I'm the first person to try using the custom file drop
handler mechanism?
My question is, it looks like no matter what file type you specify to
the addEventListener, only the x-moz-file type will get run. If you
specify image/png, for instance, it won't match a png file that has
been dropped. So you have to determine the file type on your own,
based on file name. Possibly there's a small set of types that FF will
recognize?
Mark