Open Bug 650556 Opened 13 years ago Updated 2 years ago

Show SVG preview in favicon


(Core :: SVG, enhancement)





(Reporter: waldyrious, Unassigned)


(Depends on 1 open bug, Blocks 1 open bug)


User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0

SVG files opened directly in the browser should display a preview in the favicon, like other image types do. This might be related to bug 366324.

Reproducible: Always

Steps to Reproduce:
1. Open any SVG file in the browser, say
Actual Results:  
The favicon of the site (if set) is used.

Expected Results:  
As currently happens for other images (PNG, JPG and GIF), a preview of the image should be displayed in the favicon.
Hmm... This isn't as straightforward as it might seem -- when you view SVG directly, it's treated as a document, which means it can run javascript & pull in  <foreignObject> & plugins & remote resources, all of which images (and hence favicons) aren't allowed to do.

So, if we were to e.g. show a loaded-as-an-image copy of the current SVG file as the favicon, it could potentially look very different from the actual SVG document (due to the restrictions we place on SVG-as-an-image).  Maybe that's not a big deal, though.

What do other browsers do here?
(In reply to comment #1)
> What do other browsers do here?

Opera 11 & GC 12 use the Site Icon.
GChrome actually doesn't show previews for any type of file. Images show the favicon of the site, if there's one, or the default favicon. Comment 2 on says: "we don't change the fav icon based on the content type.  that comes from the server."

But since Firefox does this for other images, it seems logical to make SVG follow the same behavior, for consistency.

Also, I don't think the differences from the actual document would be actually noticeable; even for other image formats where I assume no such restrictions are in place, it's difficult to understand the content of the image from the favicon; so that should not be a problem.
Blocks: 120352
I'm marking this as a blocker for bug 366324, since full support for SVG favicons should include this particular case.
Blocks: 366324
Arhg, typo. Please ignore my previous comment.

For comment 1, see bug 366324 comment 24.
Ever confirmed: true
Depends on: 403651
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.