Bug 386333 - Extract the mime type from data URI images in Page Info. r=mano

This commit is contained in:
Henrik Skupin 2009-09-19 12:19:00 +02:00
parent bb15489364
commit 20394f5a36

View File

@ -873,6 +873,13 @@ function makePreview(row)
if (!mimeType)
mimeType = getContentTypeFromHeaders(cacheEntryDescriptor);
// if we have a data url, get the MIME type from the url
if (!mimeType && /^data:/.test(url)) {
var dataMimeType = /^data:(image\/.*);/.exec(url);
if (dataMimeType)
mimeType = dataMimeType[1];
}
var imageType;
if (mimeType) {
// We found the type, try to display it nicely