Questions tagged [data-uri-scheme]

The URI scheme for data URIs, defined in RFC 2397 as data:[<mediatype>][;base64],<data>

The URI scheme for data URIs, defined in RFC 2397 as :

data:[<mediatype>][;base64],<data>

According to RFC 2397:

The <mediatype> is an Internet media type specification (with optional parameters.) The appearance of ;base64 means that the data is encoded as base64. Without ;base64, the data (as a sequence of octets) is represented using ASCII encoding for octets inside the range of safe URL characters and using the standard %xx hex encoding of URLs for octets outside that range. If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII. As a shorthand, text/plain can be omitted but the charset parameter supplied.

For questions about data URIs that are not specifically about the data URI scheme, use the tag .

22 questions
13
votes
1 answer

Including base64 gzipped stylesheets/images in javascript?

I know you can include css and images, among other file types, which have been stored in base64 form within a javascript file. However, those are decently huge... and gzipped, they shrink down a LOT, even with the ~33% overhead from base64…
BrianFreud
  • 7,094
  • 6
  • 33
  • 50
13
votes
1 answer

Wildcard MIME subtype

I'd like to use image/* MIME type in data URI e.g. data:image/*;base64,R0lGODlhE... in element. Is it standard-compliant MIME type at all? Can it cause problems in some browsers and if so, in which?
Maxim Kachurovskiy
  • 2,992
  • 2
  • 21
  • 24
5
votes
1 answer

Data URI default charset

Is there a default charset for data URIs? I read the spec but I don't see one. For instance, if I have a data URI for a source map which I expect to be reliably interpreted across browsers, is it OK to omit the charset? //@…
Jackson
  • 9,188
  • 6
  • 52
  • 77
5
votes
2 answers

Detect if browser supports data uri scheme with iframes

Internet Explorer does not support the data uri scheme for iframe urls (see http://msdn.microsoft.com/en-us/library/cc848897%28v=vs.85%29.aspx). Other browsers do. As browser detection is loaded with testing and future-proofing problems, I want to…
4
votes
2 answers

HTML displayed using Data URI can't access relative paths

I have an HTML string with me like this: var str = "hello
"; Now, I need to show this HTML in an iframe,…
tapananand
  • 4,392
  • 2
  • 19
  • 35
3
votes
2 answers

What is the best way to load an image faster, either the .png/.jpg format or the data URI scheme?

Does loading an image in the data URI format, make it load faster in the page? For example:background: url("data:image/jpg;base64,/someImageData") Or does it load faster in the common .jpg or .png format? For example: background:…
user5799177
3
votes
2 answers

chrome.tabs.executeScript into dataURI tab

Question is very simple (to ask) Is there any way to inject script into tab containing only image and have URL in form of: data:image/png;base64,iVBORw0K.... console gives me error: Cannot access contents of url "data:image/png;base64,iVBORw0K....
Wolf War
  • 1,503
  • 1
  • 15
  • 28
3
votes
1 answer

How can I display image of blob type in php?

I'm trying to display an image, but that image type is blob. Question: How can I display blob data type image? I tried with: function getBlob() { $data = $this->user_model->getBlob(); echo "
Secure
  • 133
  • 2
  • 2
  • 11
3
votes
1 answer

Data URI ASCII, UTF-8, or base64

When including a Data URI in an HTML page, is it best to use ASCII, UTF-8, or base64? I am using it for an SVG file which can be represented as any of these. The UTF-8 (once URI encoded) is still a bit smaller than base64 when uncompressed, but are…
Justin Elkow
  • 2,833
  • 6
  • 28
  • 60
2
votes
0 answers

How to detect if browser supports downloading a link that points to a data: URI scheme

I have an anchor tag that points to an encoded image and includes the download attribute. The goal is to allow the user to download the data URI (image) to disk simply by clicking on the link. Example:
Jed
  • 10,649
  • 19
  • 81
  • 125
2
votes
3 answers

Does Flex support the data uri scheme?

I wish to pass many small PNG files as base64 encoded URIs within an XML response, but there seems to be no way to make flex present these images. I was thinking of the data uri scheme, but it appears not to be supported. Proposed solutions Use…
Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
2
votes
1 answer

Is there any case where application/javascript (as a MIME type for Javascript) won't work?

The question is text/javascript works across the board but application/[x-]javascript is correct. Is there any reason not to use text/javascript? Background: I've discovered an interesting corner case where Chrome will refuse to execute Javascript…
podperson
  • 2,284
  • 2
  • 24
  • 24
2
votes
1 answer

Populate with source created dynamically with Java

I'm using Java to create dinamically images and put them into a jsp page. This works fine in all browsers, except for IE 7. I'm using Data URIs in my jsp to populate tags (I'm using a base64 string). I've found many solutions for IE, but no one…
Giorgio
  • 41
  • 1
  • 5
1
vote
0 answers

JWPlayer 7 Vulnerability

The jwplayer.js file for Version 7 is being rejected as a high risk vulnerability by the PaloAltoNetworks' firewall due to its use of the RFC 2397 "data:" URL scheme. This does not bode well for the new player. Has anyone found a workaround or…
srtuttle
  • 41
  • 2
1
vote
2 answers

Show image from Data URI scheme on Java panel

I am having trouble interpreting this question. I receive a img in JSON formated in Base64, for web developers its only do: "". How I can make it in Java?
rodrigo
  • 342
  • 1
  • 2
  • 12
1
2