I have a custom Firefox toolbar with a button on it.
I wish to be able to drag-n-drop images from the current page onto the button, and grab the URL of the image that was dropped.
I can see that dragging and dropping an image into, say, a form's text element or the browser's address bar deposits the dropped item's URL into the field. I want to grab that same URL with my toolbar's button when the item is dropped onto it.
I can see that the image's URL would be dropped as a new button if I were to drop it on the Firefox Bookmarks toolbar, so perhaps what I seek is similar?
In my custom toolbar, I do not see the insertion indicator, as I do with the Bookmarks toolbar, and I get no "event.dataTransfer" data when I drop.
Thanks in advance for any pointers. Get as techie as you like ... I dig that stuff. ;)
I decided to try something I hadn't tried ... and I got it. The toolbar button needs to have both "ondragenter" and "ondragover" event handlers set to "preventDefault()" in order to make the button a drop target. Once done, whatever is dropped onto it will reveal its secrets.