Guh. I should really take the time to learn JavaScript.
I use FireGestures with Firefox, and have a mapping that saves the current image the gesture begins on and then closes the tab. This is handy on sites like tumblr, where I might open a handful of images with the intentions of saving them.
The script, such as it was, looked like this.
var srcNode = FireGestures.sourceNode; var linkURL = FireGestures.getLinkURL(srcNode); if(srcNode.nodeType == Node.ELEMENT_NODE && srcNode instanceof Components.interfaces.nsIImageLoadingContent && srcNode.currentURI) { saveImageURL(srcNode.currentURI.spec, null, "SaveImageTitle", false, true, makeURI(srcNode.ownerDocument.location.href), srcNode.ownerDocument); var tab = gBrowser.mCurrentTab; if(tab.nextSibling) gBrowser.mTabContainer.selectedIndex++; else gBrowser.mTabContainer.selectedIndex--; gBrowser.removeTab(tab); }
It works, up until the latest update of FF or FG. I've spent an hour and a half trying to figure out what broke. Of course, the FireGestures site isn't responding, so whatever pittance of documentation they have available... isn't. Even more frustrating, every modification of a script requires one to not only save it from the edit window, but to also back out of the FG options window entirely before it takes effect. This is really tedious, particularly when you don't really know what you're doing. :D
So I figured I'd try digging around in the extension's code a bit. After about 10 minutes of browsing, it seems that everything I'm trying to do can be done with internal FireGestures commands:
FireGestures._performAction(null,"FireGestures:SaveImageNow"); gBrowser.removeCurrentTab({ animate: true });
Hopefully, someone else might find this handy, although it's the sort of thing I'd usually blurb about on my computer nerd blog rather than Tumblr.










