Danbooru Image Uploader
danbooruup is a Firefox extension to facilitate uploading of images to danbooru from local files or sites that have some sort of referrer or cookie hooplah.
Release Notes
Latest version is: 0.3.2, released on October 18, 2007 23:34 PST. Download
Firefox 1.5 version is: 0.2.6, released on August 11, 2006 19:22 PDT. Download
danbooruup 0.2.7 and newer require at least Firefox 2.0.0.1. Use version 0.2.6 for Firefox 1.5.
This extension adds a context menu item when right-clicking on an image to upload an image to a danbooru. The default is http://danbooru.donmai.us/, more can be added in the extension options. Also added are an MD5 hash and an SHA-1 hash in the Element Properties window, and tag autocomplete for danbooru sites.
Version 0.3.2 adds several new features to the upload dialog. First, is the inclusion of related tags in the autocomplete popup. Press Insert (or Help on a Mac keyboard) while a autocomplete choice is selected to display the related tags. Second is the ability to right-click on one of the autocomplete results to navigate to open a new tab for that tag in the selected destination danbooru. Third is the artist search button, which will query the selected danbooru for an artist tag based on the source URL currently selected in the upload dialog.
The autocomplete popup is now styled based on tag types as of version 0.3.0. The colors can be changed in the extension options. Note that changing the font size will not change the cell height to fit the text.
Autocomplete for tags functions in much the same way the form and URL autocomplete input boxes work. Note that you must use the right arrow key to complete instead of the enter key, unless you intend to complete and sumbit at the same time. Use a * (asterisk) for wildcard searching. Note: normal searches automatically append a * to the end, but if you specify your own wildcard, this does not happen, allowing you to search for tags with a particular ending.
Autocomplete for danbooru sites uses the script.aculo.us Autocompleter, with modifications to make it work a bit more like the usual autocomplete popup. Currently, the root danbooru page search box, /post/list search box, and the /post/view and /post/add tag boxes will have an Autocompleter attached. Determination of which domains this works for is based on the sites added in the Danbooru Sites tab in the extention's options dialog. The Autocompleter will attempt to hook to any URL that is in one of the domains and matches /post/(list|view|add)(/|$)
or has an element with id static-index
. Note that the URLs entered into the options dialog still have to be /post/create.xml (or the older /api/add_post) paths in order to upload to the sites.
As the code for the native component is partly swiped from the Mozilla source, the extension is licensed under the MPL version 1.1. Source repository is readable at svn://donmai.us/danbooruup/, browsable at the danbooru trac. Please submit bug reports there as well (if it's up). The extension borrows code from GreaseMonkey for the script insertion, and of course Sam Stephenson's prototype.js, along with effects.js and controls.js from the script.aculo.us library.
The Storage API is now included in Firefox 2 and as such no longer needs to be distributed alongside the extension.
To Do list, various notes, known issues
- Remember that the latest version of danbooru uses /post/create.xml as the upload target URL, and /tag/index.xml as the tag update source URL.
- 0.3.2+: You need to manually update the related tag database through the options dialog before you can search for any.
- Restart Firefox if the disk your profile resides on ever runs out of space. This is a sqlite problem, and Firefox 2.0 doesn't notify you correctly if it happens. It will end up stuck in an infinite loop.
- The insertion works like Greasemonkey's (version 0.7), along with the associated pitfalls. Theoretically, the worst that can happen is someone locking up Firefox by running a lot of tag searches.
- The script.aculo.us Autocompleter doesn't work so well with long text in input fields; you'll see what I mean if you use the tab key to complete tags until you exceed the displayed width of the input field. There isn't any obvious way I've found yet to scroll the input field's view, so just use the arrow keys to complete a tag instead if that sort of thing bothers you.
- Might not need to read in local files any more, since that code predated autocomplete and was a workaround for not having any native code.
- Non image-file extensions don't upload despite Firefox reading them correctly.
- Images that are the result of a POST request currently will not be properly re-retrieved.
- Huge files (around the 10 MB range) will consume a large amount of memory during processing. Especially if that file is local, due to the method required to read local files for uploading.
- Messages given by X-Danbooru-Errors probably need better processing.
- Too bad minheight/minwidth don't work for XUL windows.
Release History
- 0.3.2 (October 18, 2007)
-
- Added related tag search.
- Right-clicking on an autocomplete choice will open a new tab showing that tag in the selected danbooru.
- Added artist tag querying to the upload dialog.
- The uploader now queries the MD5 with the target danbooru (only if it is a /post/create.xml target) before uploading the entire image.
- Fixed underscore escaping for tag searches.
- Site AC now works for tag_alias/add and tag_implication/add.
- The source switching buttons now are visible in OS X.
- Upload progress bar added.
- The options dialog now actually uses the displayed value in the text boxes for updating instead of the preference value, which would not be the same on a Windows system.
- Some error cases are handled a bit better by the uploader.
- Fixed a possible crash from the uploader's manhandling of the browser notifications.
- Added a progress window for (related) tag updating from the options dialog. Tag processing progress needs a separate thread, and I don't want to figure out how to do it with Gecko 1.8. The code for it is there and working for Gecko 1.9, though.
- Fixed a couple of existing memory leaks.
- Fixed the transparency of the attention icon.
- There's still a crash bug around which I haven't been able to reproduce.
- Apparently Firefox 2 truncates SHA-512 hashes to 64 hex digits before comparing, thus rendering it and probably SHA-384 useless for XPI hash verification through the RDF.
- 0.3.1.2 (October 5, 2007)
-
- Inadvertently left a .zip of scriptaculous in the archive. Whoops.
- 0.3.1.2 (September 23, 2007)
-
- /tag/index.xml as a tag source now works properly with the addition of limit=0 to the query string. Legacy versions of danbooru with /api/find_tags should safely ignore the extra parameter.
- Injection location matching now uses filePath to ignore query strings, letting site AC work when viewing a page and/or searching.
- Fixes to uploader's error response handling. Handles <response/> API responses as well as <response>...<response/> responses now. Should now work with newer versions of /post/create.xml.
- Metadata dialog fields now are read-only.
- Injection now stops considering non-http/https protocols.
-
- Minor tweak to contentLoad function to match GM code.
- Other small fixes to metadata dialog code.
- 0.3.1.1 (March 9, 2007)
-
- Options dialog height was an insane size. localstore.rdf :argh:
- 0.3.1 (March 9, 2007)
-
- Site AC results now are styled.
- Can now switch between document referrer, document location and image location in upload dialog.
- Fixed value column being zeroed by tag update.
- searchTags now takes a limit parameter.
- Site AC inserter no longer relies on an existing A element to determine line height.
- Gave up trying to fix options dialog for OS X. The dialog's height is now fixed.
- Finally updated .dll version info.
- FreeBSD_x86-gcc3 build added.
- 0.3.0.1 (March 6, 2007)
-
- Forgot to comment out debug messages for tag styles. Oops. Another bug discovered right after a release in a long-standing tradition of bugs discovered right after a release.
- Fixed site AC regex for post/list?tags= URLs.
- 0.3.0 (March 6, 2007)
-
- Experimental build of AC component for OS X. It might explode horribly, or it might not. Please provide feedback.
- Options dialog was horribly broken since perhaps 0.2.6 or so, and is now working again.
- Tag type styling added. You can change the styles in the options.
- Workaround for systems with a linux-gnu OS_TARGET not loading the component.
- Added , delimiter for site AC.
- Upload Cancel button works again.
- Added SHA-1 hex and base32 to metadata window.
- Added hashing enabling/disabling preferences.
- Added tag/* pages to site AC.
- Notifications now sent after update and clear; options dialog now should provide feedback on these operations. Clear notification may not be working.
- Possibly fixed tag type style insertion causing all the controls to disappear from upload box due to load timing.
- Upgraded script.aculo.us files to 1.7 release versions.
- Uploader notifications now are removed in a more reliable fashion.
- Moved options styles to CSS file proper.
- Options dialog and style fixed for OS X.
- Moved missing native component alert to helper service, alert can now be suppressed.
- Added some instantApply support to options.
- Tag service searchTags now returns an arrayresult, helper now uses wrapper -- see bug #360207 about property access.
- ArrayResults are now scriptable, who knows why they weren't before.
- Tag service now fixes DBs without a null constraint on value.
- Got rid of old ns prefixes on source files and classes.
- Moved nsIAutoCompleteSearch component to JS.
- Helper service now resposible for handing out tag service to consumers.
- Fixed metadata dialog to show file size for local files.
- Decided to consolidate interface definitions into one .xpt file.
- Now uses frozen string API and links to XPCOM glue.
- Autocomplete binding support for both mozilla 1.8 and 1.9. Component should compile for Firefox 3 again. Since the XPCOM glue changed, the binaries with this release linked with the 1.8.1 glue will not be compatible.
- 0.2.8.1 (January 17, 2007)
-
- Fixed issue with the tag input box not being focused when a new upload dialog was opened.
- One upload dialog per tab can now be opened.
- Tweak to browser tab focusing from the upload dialog. Still can't get it to work right in GNOME, though, but who cares!
- 0.2.8 (January 16, 2007)
-
- Autocomplete for danbooru site input fields added.
- Added a button in the upload dialog to focus the tab which opened it.
- Added MD5 hashing to Element Properties window.
- Added aHTMLTooltip crop attribute changer (the tooltip that shows up containing
title
attribute text)
- The danbooru toolbar extension now has tag autocompletion.
- Preferences should actually work now, but nobody complained before.
- Uploads that finish quickly (mostly small files) now have properly displaying browser notifications.
- Clarified component load failure messages a bit.
- Removed obsolete linkages, component should compile with Firefox 3.
- Moved the uploading code to its own service.
- Autocomplete component now works in xpcshell, formerly failing because xpcshell doesnt' register a user profile directory.
- An existing upload box now focuses if you try to open a new one from the window that opened it. Note: the image being uploaded is still changed.
- 0.2.7 (January 1, 2007)
-
- Fixed for Firefox 2.0.
- Removed Title field.
- 0.2.6 (August 11, 2006)
-
- Wildcard searching for tags.
- Cleanup of old tags (see extension options).
- Tag history database now has a .sqlite extension. The danbooruhistory.sdb is no longer used and I am too lazy to delete it for you.
- Attempting to update a tag while an update is already in progress will now be prevented.
- 0.2.5 (June 21, 2006)
-
- Finally got off my ass and created an official version that works with 1.5.0.*.
- Rating is now selectable in the upload dialog.
- Submissions now include the MD5 of the image.
- A new error icon for the browser message bar.
- Asynchronous tag list updating. Firefox's startup should no longer be blocked if danbooru is downbooru.
- Touched up code for 1.9 mozStorage interface.
- 0.2.4 (September 23, 2005)
-
- Forgot to change after to after_id for the tag list API call. Oops.
- 0.2.3 (September 7, 2005)
-
- 0.2.2 (September 2, 2005)
-
- Added option to remove file:// URLs from showing up in the source field.
- Removed old X-Danbooru-View-Url code.
- Fixed blank button in message bar.
- Now sends Content-Types other than application/octet-stream.
- Errors in danbooru won't kill your browser, which tries to display the binary contents of the file in the message bar.
- 0.2.1 (August 23, 2005)
-
- Now uses REST API.
- Reworked the internals to fix breakage caused by xpcwrappers in the latest branch builds.
- Fixed a minor bug where the nsIURI object was appearing in the message bar instead of the URL of a local file.
- Options dialog had OK and Cancel in the wrong positions.
- 0.2.0 (August 2, 2005)
-
- Tag autocomplete.
- A lot of other minor fixes, some not as minor as others.
- 0.1.3
-
- Changing the source field in the upload dialog no longer changes where the extension will try to retrieve the image from.
- Exceptions will no longer be raised from trying to show messages on an already-closed browser.
- 0.1.2
-
- You can now select from multiple danbooru, configurable through the extension's configuration.
- The extension icon correctly points to the right icon now. Thanks, rq.
- A bit more handling of various network issues instead of the hex error codes.
- 0.1.1
-
- Source input didn't actually get transmitted.
- Fixed a line of misplaced code which was breaking the response handler.
- 0.1
-