Skip to content

May I suggest implementing a "save" command #20

AlcherBlack opened this Issue Apr 2, 2010 · 6 comments

5 participants


Unixkcd is extremely convenient when browsing the comics one after another, so allowing to save a specific strip to your computer would be really nice. It shouldn't be too difficult to implement. [save + path]

sgbeal commented Apr 2, 2010

JavaScript alone cannot be used to save anything. Saving is a browser-specific feature. To save the comic, right-click the image and click "Save image" (or whatever it's called in your browser).


I like the motivation behind this idea. I think we could have a "save" command that writes the current comic to a cookie, and perhaps a "load" command that gets you back to your saved position.

Or perhaps, we could just do this automatically, and when we detect that the user has a saved position, give them a "would you like to resume where you left off? [y/n]" prompt...


Right-clicking kinda defeats my idea. Is there a way to pop up a "save image" dialog using javascript? (The idea with cookies is brilliant though, and definitely should be implemented)

danopia commented Apr 3, 2010

You can have the server return the image as an attachment so that the browser prompts to download (chrome will do it without asking). For saving your spot, though, chromakode has the right idea.


In response to sgbeal:

Can't java read what web browser is viewing it? This would allow an if...else tree to save using different methods. I use Firefox, so I can just right click an image to save it, but if it makes people happy to save images using, then they should be allowed by whoever writes the code.

sgbeal commented Jan 7, 2011

@Nick: neither Java-in-a-browser nor JavaScript have access to save anything to the local machine with the exception of cookies. (This code is JavaScript, not Java, and they actually have nothing to do with each other despite the naming similarity.) Yes, the data could be streamed from the server as danopia suggested, using a separate ajax callback. The user might, depending on the browser, be prompted for where to save it or it might just be saved in the currently configured downloads directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.