Sunday, September 13, 2009

I love greasemonkey

So if anyone who's reading this reads Sankaku regularly, then you know that their NSFW galleries tend to have a joke image at the end of them. As these NSFW galleries are typically of females in various states of undress, it means the final image is typically a guy.

I took a look at their source and said "hey, writing a Greasemonkey script to toggle the last image would be pretty easy!"

So I told Greasemonkey to make a new user script and set off...

Success, of course.

It hides the image by default, and puts the toggle at the bottom, just above the NSFW content toggle. I couldn't find a good way to have it save the preference. Since all toggling would happen after Greasemonkey removes its stuff from memory, I'd have to use cookies. Since I didn't feel like remembering how cookies work in Javascript, I just didn't write in a preference. It kind of works anyway because we want to be on the safe side all the time and not show that last image until the user explicitly says otherwise.

I'm rather tired at the moment, but after I get some sleep I might upload the script somewhere. I've done a lot of development in the past couple days, having hammered out a private messaging system for CAINE's forums in about 12 hours Friday night/Saturday morning, counting breaks for food. Custom forum software both for the win and for the loss, I guess. I'll probably spend the next few days avoiding writing any sort of code whatsoever.

No comments:

Post a Comment

I moderate comments because when Blogger originally implemented a spam filter it wouldn't work without comment moderation enabled. So if your comment doesn't show up right away, that would be why.