Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome - "Save As..." disabled in right click menu when using a "data" url

If you paste the following into the url bar in chrome and try to do right click-> save as... the save as... is grayed out. Any way to stop this from being grayed out?

URL:

data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%0D%0A%3Chtml%20lang%3D%22en%22%3E%0D%0A%3Chead%3E%3Ctitle%3EEmbedded%20Window%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%0D%0A
like image 345
alumb Avatar asked Jul 07 '11 19:07

alumb


2 Answers

Data URLs are, at the moment, explicitly excluded from the list of savable URL schemes (see http://codesearch.google.com/#OAMlx_jo-ck/src/content/common/url_constants.cc&type=cs&l=11 for context). I'm not sure that that's absolutely correct, and if you file a bug at http://new.crbug.com/ I'd be happy to pass it on to the right team for review.

But, short answer: you can't save data:* URLs right now.

like image 169
Mike West Avatar answered Sep 24 '22 02:09

Mike West


Make the data uri into an anchor tag (<a href="data:etc....</a>"). Then, change the mime type of the data uri to application/octet-stream and the browser mime map will open a save as box when you click the anchor tag.

like image 20
Tom Avatar answered Sep 22 '22 02:09

Tom