This updated copy of the patch corrects Content-Type defaulting (text/plain;charset=US-ASCII if empty, text/plain if empty but charset given.) This appears to work with all the Mozilla data: URL test-cases except the JavaScript, CSS, XUL and MP3 ones (the MP3 one deserves further investigation.) See: http://www.mozilla.org/quality/networking/testing/datatests.html On 12/5/05, Ben Wiley Sittler <bsittler@gmail.com> wrote:
Hi! I've been using dillo a bit since the i18n patch became usable, and found that there was one crucial URI scheme missing: "data:", defined in RFC 2397. I used the simple filter DPI model and had something working fairly quickly (thank you all for making that easy!)
This works by adding a filter for dpi:/dataurl/... and rewriting data:... to use it, in a fashion similar to the one used by the https filter.
The data: URI scheme allows image data (and other linked resources) to be embedded in a web page, so (for example) your DPIs can now trivially embed images, even dynamically-generated ones. It is also supported by the Mozilla family (it's used heavily in GreaseMonkey plugins) and in Konqueror and Safari.
Here's an example data: URI (an image) from the RFC:
<IMG SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7" ALT="Larry">
The ";base64" is optional, and indicates Base-64 encoded data. The default is unencoded, i.e. just URL-escaped. Here's a non-Base-64 conversion of the same data:
<img src="data:image/gif,GIF87a0%000%00%F0%00%00%00%00%00%FF%FF%FF%2C%00 %00%00%000%000%00%00%02%F0%8C%8F%A9%CB%ED%DF%00%9C%0EH%8Bs%B0%B4%AB %0C%86%1E%14%96%A64.%E7%2A%A6%09%8B%1A%A7%2B%AFQIo8%D9%8Ef%D7%F3%80 %5C%C1%C90u%D1%0819%1D%13%A8%14%1E%8E%14M%CC%E7%E4T%9F%B9b%25%2A%AD qyc%99J%87%F0%DE%B8%D7%0F%E7%22%D6%1A%C1%1B%B4%B8%8EJ%96%BFL%F8%3B% 26%92G%C7%27%A7w5%93%05%F5%F4s%13%A7%28%F8%E0%078%B8v%28%A7Xgd%17%C 9%23u%F9%F2q%06We%E6%06z9%89%95%97%86%97%D8%B6%89%C5jh%D5Z%8AT%FA%1 7%98%89%F7I%BA%9A%FB%93K%83%8A%D3%934%BC94C%85%D4%B7%0B%CA%3B%3A%DC wx%AA%F6%E8%AC%17%CDL%D4%E2%1CG%B9D%7B%0C%1C.%9E%ED%B8%D3d3%7B%8D%9 D%AD%C5%D8%94%05%A3%DE%D5%AE%2C%BF%5E%5E%3F%7FW%1F%E5U%B3_%2C%A6%EC %F1%E1%87%1E%1Dn%06%0A%00%00%3B" alt="Larry" />
So far this DPI has only been tested with the i18n-patched version of dillo (I use it to load small test texts in different charsets), but it should theoretically work in regular dillo too.
Enjoy, -ben