# Empuzzler: A user script for hiding comments and answers until you want to see them

I've created a user script that hides comments and answers on Puzzling.SE's main site by default, and reveals them only when you want them revealed.

I've done this because I'm the sort of person who dislikes having potential spoilers or answers in view or at risk of being in view whilst I'm mulling over a puzzle. They're too tempting to glance at! I have to put mental effort into not scrolling, or averting my eyes from certain sections of the screen, and so on. There's so much more peace of mind for me in those answers simply not being there until I'm ready to look at them.

I'm also the sort of person who happens to be able to do something about it, because I can create user scripts. So I made a solution for this problem for myself, and thought some of you might want to use it too.

It's called the Puzzling.SE Empuzzler. You can get it here on Greasy Fork.

• Chrome users ought to be able to add it straight away.
• Firefox users will need Greasemonkey.

It runs exclusively on Puzzling main site questions, so it won't do its thing on any other SE site, nor on Puzzling Meta.

The result currently looks like this on this question:

see this bit right at the end. ↑ No comments or answers in sight until I want them there.

There may be places to improve it still. If there's anything it should do differently, or anything it doesn't do that it should, please let me know.

# Todo

2. Logged-out users get a login prompt when they expand the comments section. Need to make sure this doesn't happen.
3. Add a way to turn all spoilers in answers into regular un-spoilery quotes, since peoples' practice of spoiler-protecting their answers is redundant if you're using Empuzzler. Possibly also the same for questions, but separate.
• Nice script! If you want prettier buttons, you could use a <input type="submit"> instead, but looks great otherwise! Oct 8 '14 at 11:43
• @Doorknob Thanks! I've added a Show Everything! button, and tried out that style along the way - all three bright orange buttons together is glaring though, so I've decided to stick with the classic styling for now. When the site leaves beta, if its new skin has less vivid buttons, I'll see about switching over to the pretty ones again. Oct 8 '14 at 13:53
• Ah, right, I meant <input type="button">. That should be a bit less... excessive. Oct 9 '14 at 0:00
• @Doorknob Don't both have the same style? That's the one I used actually ;) in the name of semantics I couldn't bring myself to use the submit type. Oct 9 '14 at 0:02
• @Doorknob input[type=submit] has the same orange styling as input[type=button]. Only button is grey :-)
– Joe
Oct 9 '14 at 0:04
• @Doorknob if you already installed this; I've updated it and added (or, really, fixed) the auto-update. You might want to update to this version to get that auto-update going. (This message will self-destruct when acknowledged.) Oct 9 '14 at 1:07
• Nice script! You know where it would fit great? Code Review :-) Oct 17 '14 at 23:02
• This would be awesome on codegolf.stackexchange.com too Dec 12 '14 at 15:27
• This is simply awesome :D Jul 20 '16 at 7:46

Chrome:

2. Rename it .user.js
3. Go to this URL: http://chrome://extensions/
4. Drag the .js onto the list of extensions
5. Allow any requested permissions
6. Riddle In Peace

Not sure if you're too fussed, but I took the liberty to tidy it up a little bit - moved all the vars to the top, rewrote some parts, etc.

Feel free to ignore it :P

http://pastebin.com/9QNzrRnX

Update for 0.4 - see the changelog :-)

http://pastebin.com/j64sWkXb

• Thanks, that's certainly brought some development rigour to my hastily thrown together script. :) There's lots of parts I'll integrate (I like your method of hiding the buttons more) and some I won't mainly due to style preferences. I'll take a deeper look soon when I have the time. Oct 8 '14 at 23:34
• I've merged in your clean-up with some small changes, and fixed the auto-update which I just realised I did wrong. Oct 9 '14 at 1:05
• @doppelgreener updated for 0.4 with a couple of changes I'd wanted to make yesterday but didn't have time for :-)
– Joe
Oct 9 '14 at 9:54
• This is very cool. 8) And appears to operate well for questions with 0 comments and/or answers. Merged in. Oct 9 '14 at 13:47
• @doppelgreener It's a pretty awesome idea to be fair, I just refined it a little :P I'm fresh out of useful ideas for now though, I'm afraid
– Joe
Oct 9 '14 at 14:03
• @doppelgreener updated to version 0.5 with a couple of features d'alar'cop mentioned in chat
– Joe
Dec 5 '14 at 10:24
• Great work guys! :)
– A E
Dec 5 '14 at 13:12
• Fix for HTTPS. Mar 27 '19 at 19:58