library for parsing data URIs?

18 views
Skip to first unread message

Rick Byers

unread,
Dec 28, 2011, 1:59:20 PM12/28/11
to web-i...@googlegroups.com
If web intents are going to encourage the use of data URIs for passing data by value encoded in a URL, then I think we need to supply a standard library for parsing these URIs.  It looks like all the samples today just store the received URI as the src of an img element.  Real-world scenarios will often require manipulating the data directly in JavaScript.

I had hoped that XmlHttpRequest would be able to handle both http: and data: cases for me transparently, but XHR intentionally doesn't support data: URIs (see thread on this here: http://lists.w3.org/Archives/Public/public-webapi/2007Oct/0017.html).  Naive parsing is easy, but fully supporting all cases is more complicated.  See, for example http://shadow2531.com/opera/testcases/datauri/data_uri_rules.html.

Rick
Reply all
Reply to author
Forward
0 new messages