-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
May I suggest implementing a "save" command #20
Comments
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) |
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 uni.xkcd.com, then they should be allowed by whoever writes the code. |
@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. |
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]
The text was updated successfully, but these errors were encountered: