Edit: Hm... I tried re-installing the downloader, apparently it no longer de-compresses itself to its own extension folder. The only difference if it does NOT de-compress, is to unpack the "
danbooru_downloader@cuberocks.net.xpi" archive to its own folder, and then perform the same edits. If you don't feel like repacking it (zip format, compression optional) and renaming it to an ".xpi" file, you can probably just delete the .xpi and Firefox should detect the addon in its folder. BUT I have to verify that last bit. Unpacking/repacking the .xpi is the same procedure as for the ".jar" file.
In the meantime, I wouldn't modify the .xpi files unless you've done it before, since I haven't tried that method yet.Edit^2: Just remember to delete either the unpacked folder OR the XPI file before you try to launch Firefox again. It doesn't like it when two addons have the same name... as I can attest after spending about 10 minutes trying to figure out why I didn't seem to have
any. -facepalms-
Disclaimer: Back up the DD extension before you do any of this. I might have forgotten a step somewhere, or it might not work -quite- the same in Firefox versions less than 4. I.e. I'm not sure what "find updates" will do to the addon in older versions. This edit applies to version 1.7.1 that I found at
http://www.brothersoft.com/danbooru-downloader-397279.html, which is the only version I've come across. If you find a newer one, for heaven's sakes LET ME KNOW! XD
Oh, right, another disclaimer: I haven't gone through all of the code, and I don't know anything about XPI installers. If it destroys the world or taints your soul gem (or both), I take no responsibility!
Short Version|| if you have at least as much clue what you're doing as I did at the time
Edit "danbooru_downloader
_tab.js" in "danbooru_downloader
.jar\chrome\content\" in the extensions folder. Be sure to repack properly. Compression doesn't seem to matter, but if you accidentally repack with an additional folder level the addon won't function at all. After doing all that, force Firefox to re-validate the addon by checking for an update and restart.
If your editor doesn't support line numbering, you can just search for the contents, there should only be one hit.
Original code: danbooru_downloader
_tab.js || LINE 329
var details = this.tabDocument.getElementById('stats').childNodes[3].childNodes;
Replacement code: danbooru_downloader
_tab.js
//MODIFICATION|ph4zr BEG
var stat_section = this.tabDocument.getElementById('stats').childNodes;
var child_x = -1;
for(var x=0; x<stat_section.length; x++)
{
if(stat_section[x].tagName == "UL") {
child_x = x;
break;
}
}
//MODIFICATION|ph4zr END
//MODIFICATION|ph4zr LINE
//REPLACEMENT
var details = this.tabDocument.getElementById('stats').childNodes[child_x].childNodes;
//ORIGINAL
// var details = this.tabDocument.getElementById('stats').childNodes[3].childNodes;
There is probably a better way to do all of that, but I was trying to stick as close to the original coder's style as possible, with as few edits as possible. If I had my way I'd probably change some of it to regexps and go through commenting all the code. Most people don't look at the source, though, so comments would likely just bloat the addon—mine would literally almost double its unpacked size if I took the time to do it.
Long Version|| if you aren't really sure where to find stuff, or aren't very comfortable with archives
If you want gelbooru ratings to be identified properly, you can modify the extension according to these instructions. You will need
7-zip or an equally functionally archive/ZIP program, a text editor for saving in -plain- text (I prefer Notepad++ on Windows), and the ability to find DD's extension folder. You -should- be able to find it on Windows at:
%appdata%/Mozilla/Firefox/Profiles/__USERSPECIFIC_DIRECTORY__/extensions/danbooru_downloader@cuberocks.netThe %appdata% string is an environment variable that should de-reference properly if you just paste it into an explorer window.
Obviously "__USERSPECIFIC_DIRE
CTORY__" is a directory that changes per person, so you'll have to browse to it yourself. If that doesn't work, the -default- user %appdata% value is "C:\Users\__USERNAME__\AppData\Roaming\", keep in mind that "AppData" is a hidden folder by default.
Now that you're here, browse to the "chrome"* folder. Take a second to
back up "danbooru_downloader
.jar"**, just as a precaution in case something goes wrong. Depending on how comfortable you are with zip files (or extensions in general), you can either unpack the entire zip file or just extract "danbooru_downloader
_tab.js" from "danbooru_downloader
.jar\chrome\content\" for editing.
*I don't know why it's called that either.
**Assuming you have file extension display enabled. If you don't, you can enable it in Windows via "Explorer Menu/Tools/Folder Options | Tab:View", by unchecking "Hide extensions for known file types". The menus might be slightly different depending on your OS version./branch
If you did NOT unpack the entire thing, make your edits to the file, save it somewhere, and add it back to the right folder in the archive (I just drag it to the window). 7-zip will probably compress this, but it didn't seem to have any effect.
/alternate branch
If you unpacked the entire thing, browse to the file and perform the edits at the top. After you do this, add the
unpacked "chrome" folder to a 7-zip archive in ZIP format with the "store" option for compression settings. You can probably compress it, but the original isn't compressed, so I figure "why tempt fate?"
If you did this properly, by default 7-zip will have created a "chrome.zip" file. Take a second to verify that "chrome" is the top level folder in the archive, if it isn't you need to make sure to repack the actual "chrome" folder, not its contents or the folder it's in. If you are repacking, make sure you're repacking the one you created when you decompressed the archive. Now rename "chrome.zip" to "danbooru_downloader
.jar" and place it in location of the original "danbooru_downloader
.jar" file. At this point you can delete the unpacked files.
/branch end
Having done that, -restart- Firefox and open up the addons panel. In Firefox 4, scroll all the way down to the bottom, you'll notice that "Danbooru Downloader" is disabled as "incompatible". Just
right-click and click "find updates". This won't actually do anything, but Firefox will do whatever it does and ask you to restart. Once you do that, the addon should work properly.
Lazy Version|| for those who are just lazy bastards (like me) and/or have a high level of trust (not like me)
Assuming you're fine with not knowing what you're putting into your addons folder, you can just download
"danbooru_downloader .jar" directly from the following link and place it in the appropriate folder (detailed above in big bold letters) the XPI file and install that to Firefox the same as any other extension.
... after you back up the other one in case things go horribly, horribly wrong. Alternatively, you can download the modified source file and replace it in the appropriate archives.
XPI file: Install this directly
http://www.megaupload.com/?d=YPH7FW9NJAR file: Replace the original JAR file in the DD extension directory
http://www.megaupload.com/?d=296A4WOVZIP archive of modified source file: ...if you're downloading this, surely you know what to do with it.
http://www.megaupload.com/?d=61PTB8KR