ObscureTags.com: data url example

Only losers link to external images off their web pages.

Real men take advantage of the the data url. Basically, it lets you encode base64 data in the image's url itself. Instead of pointing an img src to a gif somewhere, you can embed your image data inline, right in the html on your page.

This only seems to work in Mozilla/Firefox, not IE. Support from other browsers is dubious.

Nancy Reagan and Mr. T, Christmas 1983

main menu

forums

Source:


Comments:

Mark
2007-05-18 06:01:24

heres a bookmarklet for selecting and showing the base 64 encoded image in another popup window... tried on opera
javascript:(function(){var str=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!str) str=prompt("input text:", "");if(str!==null) msgWindow=window.open("","","location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=547,height=442");msgWindow.document.write("<html><HEAD><title>b64_image</title><SCRIPT LANGUAGE='JavaScript'></SCRIPT></HEAD><body><img name=img1 src='data:image/jpg;base64,"+str+"' alt='Base64 encoded image' onclick='close();' width='' height=''/></body></html>");msgWindow.document.reload})();


Alexander Selkirk
2007-02-24 20:46:03

MHTML is also an actual standard ("MIME-encoded HTML"), it's just that Firefox and Opera implemented this crappy excuse for it and didn't do MHTML.


JPSofCA
2007-01-02 10:56:35

Hmm...interesting.


Tom W.M.
2006-12-29 22:31:28

Actually, it's supposed to work in just about all modern browsers besides IE. I know that it works in Opera, and I think that it does in Safari/KHTML/WebKit as well. It's an actual standard--there's even an RFC: http://www.ietf.org/rfc/rfc2397.txt


Alexander Selkirk
2006-12-23 14:03:33

Whoa! One feature where it's actually Firefox and Opera that fumble instead of IE. This is embedded images for browsers that are too pansy to tackle MHTML.


murkin
2006-12-22 22:47:04

Ah come on. Lots of people use data urls.

In Greasemonkey (which is heavily sandboxed and prevented from causing general havoc) you can fire-up a spreadsheat with a url like:

data:application/vnd.ms-excel;base64,YQliCWMKZAllCWY=


Anon
2006-12-20 05:47:16

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAECAIAAADnFEOFAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAIBJREFUGFddT0sOhSAQI/wJBPH+l0SICaDIq87uzWJS2k4bmFLKe38cx1rLOXddF2PseR48Aay1YAhrrXvvAO/knI0xJPztMUZrjXMOvpSCDcy2bSMfsvd9h4MwUtEQQiB1zhljrLXe9/324AwyWKpNKZ3n+eZ9QzdCCHwBHinlD4upYDGkEezaAAAAAElFTkSuQmCC

heh cool.


Add your comments here
Name:
URL:
MSG:
1000 Characters max. HTML will be entitized. We record your IP.
The number of the beast =