Favicon: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Added advantages of using .ico over .png or .gif
Line 229: Line 229:
Defeating Ssl Using Sslstrip (Marlinspike Blackhat)
Defeating Ssl Using Sslstrip (Marlinspike Blackhat)
|date=21 Feb 2011|first=Moxie|accessdate=9 July 2011|last=Marlinspike}}</ref>
|date=21 Feb 2011|first=Moxie|accessdate=9 July 2011|last=Marlinspike}}</ref>

==Advantages of using .ico over .png or .gif==
It is suggested to avoid using .png or .gif instead of .ico file as your site favicon. Here are the main advantages of .ico file format:<ref name="faviconer">{{cite web|url=http://faviconer.com/about#advantages|publisher=Faviconer|work=(see detailed explanation)|title=
Why should I use ICO's instead of PNG's or GIF's?
|date=07 Mar 2012|first=Moxie|accessdate=07 March 2012|last=Faviconer}}</ref>
# Compatibility - All browsers, including IE 5.0 support .ico format.
# Avoid 404 server errors - All modern browsers (tested with Chrome 4, Firefox 3.5, IE8, Opera 10 and Safari 4) will always request a favicon.ico so it's best to always have a favicon.ico file, to avoid a "404 not found" errors.
# .ico file can hold more than one icon, no need to have multiply files for 16x16 and 48x48 icons


==References==
==References==

Revision as of 08:29, 7 March 2012

A favicon /[invalid input: 'icon']ˈfæv[invalid input: 'i-']kɒn/ (short for favorites icon), also known as a shortcut icon, Web site icon, URL icon, or bookmark icon, is a file containing one or more[1] small icons, most commonly 16×16 pixels, associated with a particular Web site or Web page.[1][2] A web designer can create such an icon and install it into a Web site (or Web page) by several means, and graphical web browsers will then make use of it.[3] Browsers that provide favicon support typically display a page's favicon in the browser's address bar and next to the page's name in a list of bookmarks.[3] Browsers that support a tabbed document interface typically show a page's favicon next to the page's title on the tab, and site-specific browsers use the favicon as desktop icon.[1]

Wikipedia's favicon, shown in Firefox

History

In March 1999, Microsoft released Internet Explorer 5 which supported favicons for the first time.[4] Originally, the favicon was a file called favicon.ico placed in the root directory (e.g., http://en.wikipedia.org/favicon.ico) of a web site. It was used in Internet Explorer's favorites (bookmarks) and next to the URL in the address bar if the page was bookmarked.[5][6][7][4] A side effect was that the number of visitors who have bookmarked the page could be estimated by the requests of the favicon. This technique has become obsolete since all modern browsers support the favicon without bookmarking.[6]

Standardization

The favicon was standardized by the World Wide Web Consortium (W3C) in the HTML 4.01 recommendation, released in December 1999, and later in the XHTML 1.0 recommendation, released in January 2000.[8][9] The standards use a link element with a rel attribute in the <head> section of the document to specify the file format, file name and a location can be specified for any website directory. The consequences were that the use of a reserved location on a website is no longer required and the favicon file can be located anywhere in the web directory tree and any image file format can be used.[10][11]

In 2003 the .ico format was registered with the Internet Assigned Numbers Authority (IANA) under the MIME type image/vnd.microsoft.icon.[12] When using the .ico format, Internet Explorer cannot display files served with the standardized MIME type. A workaround for Internet Explorer is to associate .ico with the non-standard image/x-icon MIME type in Web servers.[13]

RFC 5988 established an IANA link relation registry,[14] and rel="icon" was registered in 2010 based on the HTML5 specification. The popular rel="shortcut icon" theoretically identifies two relations, shortcut and icon, but shortcut is not registered and is redundant. In 2011 the HTML living standard[15] specified that for historical reasons shortcut is allowed immediately before icon;[16] however shortcut does not itself have a meaning.

Legacy

Microsoft Internet Explorer only supports the ICO file format; simply changing the filename extension of an image to .ico without converting it to an ICO file will result in an error and not displaying the favicon. Netscape 7, Internet Explorer 5, and version 6 browsers will only display the favicon when the page is bookmarked and not simply when the page is visited as in modern browsers.[4]

Browser implementation

The following table illustrates major web browsers supporting different features. The version numbers indicate the starting version of a supported feature.

File format support

The following table illustrates the image file format support for the favicon.

Browser ICO PNG GIF animated GIFs JPEG APNG SVG
Google Chrome Yes 4.0 4.0 No 4.0 No Yes[citation needed]
Internet Explorer 5.0[17] No[4][17] No[17] No[17] No[17] No[17] No[17]
Firefox 1.0[18] 1.0[18] 1.0[18] Yes Yes 3.0 No[19]
Opera 7.0[20] 7.0[20] 7.0[20] 7.0[20] 7.0[20] 9.5 9.6[citation needed]
Safari Yes 4.0 4.0 No 4.0 No No

Additionally, such icon files can be 16×16, 32×32, or 48×48 pixels in size, and 8-bit, 24-bit, or 32-bit in color depth.[1][3] The .ico article explains the details for icons with more than 256 colors on various Microsoft Windows platforms.

Use of favicon

This table illustrates the different possibilities where favicons can be displayed.

Browser address bar links bar bookmarks tabs drag to desktop
Google Chrome No[21] Yes[21] Yes[21] 1.0[21] No[21]
Internet Explorer 7.0[21] 5.0[21] 5.0[21] 7.0[21] 5.0[21]
Firefox 1.0[21] Yes Yes[21] Yes[21] Yes[21]
Opera 7.0[21] 7.0[21] 7.0[21] 7.0[21] 7.0[21]
Safari Yes[21] No[21] Yes[21] No[21] No[21]
File:Opera11favicon.png
Wikipedia's favicon, shown in Opera

Opera Software added the ability to change the favicon in the Speed Dial in Opera 10.[22]

Some common browsers stopped using the favicon in the address bar, because this place will be used to show the type of the pages.

Accessibility

This table illustrates the different ways the favicon can be recognized by the web browser.

Google Chrome Internet Explorer Firefox Opera Safari
<link rel="shortcut icon"
 href="http://example.com/myicon.ico" />
Yes[4] Yes[4][17] Yes[4] Yes[4] Yes
<link rel="icon"
 type="image/vnd.microsoft.icon"
 href="http://example.com/image.ico" />
Yes No[23] Yes Yes Yes
<link rel="icon" type="image/png"
 href="http://example.com/image.png" />
Yes No[23] Yes Yes Yes
<link rel="icon" type="image/gif"
 href="http://example.com/image.gif" />
Yes No[23] Yes Yes Yes
favicon.ico located in the website's root Yes Yes Optional[24] Optional[25] Yes
precedence: prefer root or (X)HTML linked version ? root[21] ? ? ?

Only SeaMonkey doesn’t fetch favicon.ico files in the web site’s root by default.[26]

Device support

For Apple devices with the iOS operating system version 1.1.3 or later such as the iPod Touch, iPhone, and iPad, as well as some Android devices[27], one can provide a custom icon that users can display on their Home screens using the Web Clip feature (called Add to Home Screen within Mobile Safari).[28][29] This feature is enabled by supplying a <link rel="apple-touch-icon" ...> in the <head> section of documents served by the web site. If the custom icon is not provided, a thumbnail of the web page will be put on the home screen instead.[30]

The recommended basic size for this icon is 57×57 pixels, with 90 degree corners; for best display on the higher-resolution iPhone 4 screen, an icon size of 114×114 pixels is recommended.[29][31][32]

For the iPad and iPad2, the basic size is 72x72 pixels with 90 degree corners. If the rumored next generation follows the same pattern as the iPhone and iPodTouch, the high-resolution size would be 144x144 pixels.[33]

The icon file referenced by apple-touch-icon is modified to add rounded corners, drop shadow, and reflective shine.[29] Alternatively, an apple-touch-icon-precomposed icon may be provided to instruct devices not to apply reflective shine on the image.[29][30]

With Apple Formatting
<link rel="apple-touch-icon" href="somepath/image.png" />
Without Apple's reflective shine
<link rel="apple-touch-icon-precomposed" href="somepath/image.png" />

As in case of favicon.ico file, browsers and mobile devices do not require any HTML to retrieve these icons.[30] Default location for the files are apple-touch-icon-precomposed.png and apple-touch-icon.png (in order of priority) located in the web site's root.[29][30]

The rel="icon" example in the unfinished HTML5 specification suggests to use link relation rel="icon" sizes="57x57" type="image/png" instead of similar rel="apple-touch-icon" constructs.

Limitations and criticism

On slow internet connections the favicon can add a few seconds for loading the whole page, if the favicon is not optimized and too big.[34] In addition, the favicon will create extra traffic if it is not existent and a custom 404 page (not found) exists.[6][35] Finally, critics allege that by drive-by download through a custom 404 page, may be used to download trojan horses.[36]

Some old browsers such as the Internet Explorer for Mac did not support the favicon or had problems in updating the favicon if a new one was uploaded.[7][37] Another disadvantage was that some web hosts did not allow the use of ico files.[37]

The W3C recommendation only works in HTML or XHTML and not in other systems such as gopher. Additionally, the link element has to be added to every page and cannot be added to a full web site.[11] The W3C did not standardize the rel-attribute so there are other key words such as shortcut icon that are also accepted by the user agent.[11][17]

Favicons are often manipulated as part of phishing or eavesdropping attacks against HTTPS webpages. Many web browsers display favicons near areas of the web browser's UI, such as the address bar, that are used to convey whether the connection to a website is using a secure protocol like SSL. By changing the favicon to a familiar padlock image an attacker can attempt to trick the user into thinking they are securely connected to the proper website. Automated man-in-the-middle attack tools such as SSLStrip utilize this trick.[38]

Advantages of using .ico over .png or .gif

It is suggested to avoid using .png or .gif instead of .ico file as your site favicon. Here are the main advantages of .ico file format:[39]

  1. Compatibility - All browsers, including IE 5.0 support .ico format.
  2. Avoid 404 server errors - All modern browsers (tested with Chrome 4, Firefox 3.5, IE8, Opera 10 and Safari 4) will always request a favicon.ico so it's best to always have a favicon.ico file, to avoid a "404 not found" errors.
  3. .ico file can hold more than one icon, no need to have multiply files for 16x16 and 48x48 icons

References

  1. ^ a b c d Lane, Dave (9 August 2008). "Creating a multi-resolution favicon including transparency with the GIMP". egressive.com. Retrieved 25 February 2011.
  2. ^ "What's with Google's new mini icon?". BBC. 20 January 2009. Retrieved 25 February 2011. That 16x16 pixel square is the size of the favicon in question, if not the scope.
  3. ^ a b c Apple, Jennifer. "Favicon — How To Create A Favicon.ico". Futura Studio. Retrieved 25 February 2011.
  4. ^ a b c d e f g h "How to Add a Shortcut Icon to a Web Page". Microsoft Developer Network. Microsoft. Retrieved 15 March 2010.
  5. ^ McGrew, Darin (26 April 2007). "Web Authoring FAQ - 8.11. How can I have a custom icon when people bookmark my site?". Web Design Group. Retrieved 23 February 2011.
  6. ^ a b c Heng, Christopher (7 September 2008). "What is Favicon.ico? Personalise Your Site's Bookmarks". thesitewizard.com. Retrieved 23 February 2011.
  7. ^ a b "Creating favicons with Adobe Photoshop and GoLive". Adobe GoLive. Archived from the original on 7 December 2003. Retrieved 25 February 2011.
  8. ^ "HTML 4.01 Specification". World Wide weee Consortium. 24 December 1999. Retrieved 14 March 2011.
  9. ^ "XHTML™ 1.0: The Extensible HyperText Markup Language". World Wide Web Consortium. 26 January 2000. Retrieved 14 March 2011.
  10. ^ Dubost, Karl (2005). "Web site meta data profile: favicon, ..." World Wide Web Consortium. Retrieved 23 February 2011. {{cite web}}: Unknown parameter |month= ignored (help)
  11. ^ a b c Dubost, Karl (24 October 2005). "How to Add a Favicon to your Site". World Wide Web Consortium. Retrieved 25 February 2011.
  12. ^ Butcher, Simon (3 September 2003). "Published specification". Internet Assigned Numbers Authority. Retrieved 25 February 2011.
  13. ^ Irish, Paul (15 December 2010). "commit 37b5fec090d00f38de64 to paulirish's html5-boilerplate". GitHub. Retrieved 25 February 2011.
  14. ^ "Link Relations". IANA.
  15. ^ Ian Hickson (19 January 2011). "HTML is the new HTML5". The WHATWG Blog. WHATWG.
  16. ^ "HTML5 revision r6404". HTML5 Tracker.
  17. ^ a b c d e f g h i Davis, Jeff (1 March 2007). "why doesn't the favicon for my site appear in IE7?". jeff's WebLog at Microsoft Developer Network. Microsoft. Retrieved 27 February 2011.
  18. ^ a b c David (19 July 2003). "Mozilla 0.9.6 Release Notes". Mozilla. Retrieved 23 February 2011.
  19. ^ Works only on first load of the page.
    Daniel Holbert (14 April 2011). "Bug 366324 – SVG site icons (favicons, shortcut icons) support — comment 22". Bugzilla@Mozilla. Mozilla. Retrieved 23 February 2011.
  20. ^ a b c d e "Opera 7 for Windows Changelog". Opera Software. 28 January 2003. Retrieved 28 February 2011.
  21. ^ a b c d e f g h i j k l m n o p q r s t u v w x y Francis, Lewis (11 December 2007). "Chart of modern browser support for favicon". informationgift.com. Retrieved 23 February 2011.
  22. ^ "Opera 10.0 beta 2 for Windows changelog". Opera Software. 16 July 2009. Retrieved 27 February 2011.
  23. ^ a b c "REL Attribute — rel Property". Microsoft Developer Network. Microsoft. Retrieved 27 February 2011.
  24. ^ Firefox only accepts favicon.ico in the web site's root without a <link> tag if the setting browser.chrome.favicons is set to true in about:config. The default value is true. If set to false, these favicons are ignored.
  25. ^ Opera loads /favicon.ico only if Multimedia/Always load favicon option in about:config is set to 1. See Opera Support page for more details.
  26. ^ Mathias Bynens (14 April 2010). "rel="shortcut icon" considered harmful". Retrieved 15 November 2011.
  27. ^ Mathias Bynens (2 March 2011). "Everything you always wanted to know about touch icons". Retrieved 15 November 2011.
  28. ^ "iPhone Human Interface Guidelines for Web Applications: Metrics, Layout Guidelines, and Tips". Apple Inc. Retrieved 27 May 2010.
  29. ^ a b c d e "Safari Web Content Guide: Specifying a Webpage Icon for Web Clip". Apple Inc. 15 November 2010. Retrieved 25 February 2011.
  30. ^ a b c d McLellan, Drew (17 January 2008). "How To Set an Apple Touch Icon for Any Site". All in the head. Retrieved 11 March 2011.
  31. ^ "iOS Human Interface Guidelines: Custom Icon and Image Creation Guidelines, Table 8-1". Apple Inc. Retrieved 16 July 2011.
  32. ^ "Apple-touch-icon". Apple Inc. Retrieved 25 February 2011.
  33. ^ ""iPad Apple Touch Icon". Retrieved 12 February 2012.
  34. ^ Benkmann, Matthias. "How To Create And Install A favicon.ico". winterdrache.de. Retrieved 23 February 2011.
  35. ^ Cole, Linda (3 August 1999). "he Dastardly "favicon.ico not found" Error". QuinStreet. Retrieved 25 February 2011.
  36. ^ RB (15 December 2009). "The mean missing Favicon". Security Blog. G Data. Retrieved 14 March 2011.
  37. ^ a b Altom, Tim. "Creating Your Own Favicon.ico Icon For IE5". Web Developer's Journal. QuinStreet. Retrieved 11 March 2011.
  38. ^ Marlinspike, Moxie (21 February 2011). "Defeating Ssl Using Sslstrip (Marlinspike Blackhat)". (see description of video). SecurityTube. Retrieved 9 July 2011.
  39. ^ Faviconer, Moxie (07 Mar 2012). "Why should I use ICO's instead of PNG's or GIF's?". (see detailed explanation). Faviconer. Retrieved 07 March 2012. {{cite web}}: Check date values in: |accessdate= and |date= (help)

External links

Media related to Favicons at Wikimedia Commons