A simple quick and dirty image viewer various imageboard sites
< Feedback on ImageBoard Viewer/Downloader
yeah i think youre right.
when i noticed gelbooru was updated and it stopped working there i checked the others and they seemed more or less fine. some code is shared between them tho and i probably forgot to check them afterwards. ill try and fix em up but i hardly even use those ones really. when i made this i wasnt really anticipating needing to keep it updated and its a bit more work than id like sometimes..
actually for the most part danbooru seems fine for me.
its worth noting i make this for chrome and is only guaranteed to work in chrome.
sankaku is def broken tho.
maybe open the console and tell me what errors your getting
Hey PineappleMan, thanks for the replies.
Firstly, I found a temporary fix for Sankaku (which is really all I use) while comparing versions 1.45 and 1.41 of the script by reverting the line 336:
buttonInsertionPoint = document.getElementsByClassName("contain-push")[0];
back to:
buttonInsertionPoint = document.getElementsByClassName("content")[0];
Heres the Diff https://greasyfork.org/en/scripts/29330-imageboard-viewer-downloader/diff?v1=211740&v2=196793. I'm not too experienced in JavaScript and HTML but it seems like theres a clash in conventions used on different sites or something (since reverting this line breaks it on Gelbooru, for obvious reasons).
Secondly, I didn't seem to get any errors in the console on Firefox, but on Microsoft Edge I got this:
TypeError: Unable to get property 'insertBefore' of undefined or null reference
at Anonymous function (Function code:55:5)
at tms_d34aee8a_d54d_4550_acc6_edebc5b04416 (Function code:22:2)
at Anonymous function (Unknown script code:2:394)
at Anonymous function (Function code:2:1)
at Anonymous function (Function code:1:58)
at Function code (Function code:1:5)
at Anonymous function (Unknown script code:2:394)
at P.E_c (Unknown script code:3:219)
at F (Function code:57:465)
at create (Function code:66:51)
Function code (2) (2,376)
After reverting line 336 I don't get this error anymore, so it looks like its executing the method 'SetUpSiteSwitchObjs' which assigns the variable 'buttonInsertionPoint' as the 'contain-push' element (instead of 'content'). Then it gets to line 51 and executes 'buttonInsertionPoint.insertBefore', but Sankaku doesn't know what to do with that element so it throws an error. Again, I'm not too savvy with JavaScript but it seems like an easy fix would be to make special cases for Sankaku where the conventions clash.
Lastly, I took another look at Danbooru on Firefox and realised that GreaseMonkey isn't even recognising Danbooru as a site that works with the script. I'm pretty sure it was before but I don't use Danbooru much so I'm not too fussed, though it does work on Microsoft Edge. Interestingly enough, Danbooru works with v1.41's line 336 and v1.45's line 336 on Microsoft Edge.
ANYWAY, sorry for the lengthy comment, just thought I'd give you an update and some insight on what I thought might be going on. Since I've fixed it for Sankaku on my end I don't really care if you don't feel like pushing out an update. Thanks again for the handy script.
Cheers.
Yeah i already knew instantly that was what the problem would be but im impressed you found it and you knew what the problem was!
ive already updated it locally to fix that. theres still some problems in places but eh.
this is a really hacky finicky extension.
also its worth noting that it would only show up with the https version of danbooru as with the others. dunno if that wouldve been the problem but something to consider.
Welp, looks like typing danbooru in the URL and letting it autocomplete didn't automatically redirect to https, nice catch.
I guess all the problems I cared about have been fixed, thanks for the help.
Doesn't work on Sankaku Complex or Danbooru since v1.45
I noticed that the script no longer works on Sankaku Complex (chan and idol) or Danbooru since the latest update, although I tried it on Gelbooru and rule34.xxx and it does work.
To be more specific: None of the buttons show up anymore and when I click an image, nothing happens. The script still seems to correctly remove the hyperlink on images so that you can't click to go to the post, though. Tested on Mozilla Firefox and Microsoft Edge.
Other than that, the script was pretty handy and worked nicely for the most part. One very minor feature I'd suggest is to be able to exit Image View somehow (like making the 'Image View' button toggle it on or off), but other than that it performs the simple task it needs to without much problem.
Cheers.