This document discusses various questions, issues, bugs about Mozilla's data: URL parsing and protocol implementation.
This document is not an FAQ, but should address many non-testing questions about Mozilla's data: handling.
Networking protocol and standards software testsers.
Mozilla users and content creators working with data: URLs
Engineers looking for background information on data: URLs and the testing methodology.
data: URLs are defined by RFC 2397, and are described as:
Some applications that use URLs also have a need to embed (small)The URLs allow content creators to embed small files inline HTML documents, without complicated, document level formating, like using MIME and cid: or mid:
media type data directly inline. This document defines a new URL
scheme that would work like 'immediate addressing'. The URLs are of
- preferences: none
- UI: none
- errors: none
- proxy: none
- dependencies: URL parsing, base64 decoding
- consumers: File Handling, Layout
The format is very simple, but it is easy to forget to put a comma before the <data> segment or incorrectly base64 encode a file. How to use uuencode was described in a bug. Ian Hixie has a form so you can "build your own data: URL".
- Formating in HTML
A data: URL provides a file-in-a-file, which potentially can be very long relative to the width of a document. As a URL, the data: should be formattable with whitespace (LF, TAB, spaces), but there are practical issues with how that relates to base64 encoding.
- Length limitations
data: URLs in Mozilla are essentially unlimited in length. However browsers are not required to support unlimited length data: URLs as shown by the following document: Environment provided by the document.
For example, data: URLs in Opera are limited to around 4100 characters.
- Lack of error handling
Invalid parameters, in media or typos when specifying "base64" are ignored, but no error is provided.
data: should be tested by security QA and internationalization.
The data: protocol is supported by Opera v7.20 and above.
However, data: URLs are not supported by IE or Safari. If you have time to try out other browsers, please send us the results.
RFC 2397 - The "data" URL scheme
Technical review of RFC 2397