Every Single Day

Favicon 본문

PROGRAM/FRONT-ENDS(JSP+JAVASCRIPT)

Favicon

MJxDream 2016. 3. 15. 21:28

http://www.homejjang.com/11/favicon.php

Favicon

From Wikipedia, the free encyclopedia
favicon /ˈfævɪkɒn/ (short for Favorite icon), also known as a shortcut iconWeb site icontab 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 (sometimes in the history as well) 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 a desktop icon.[1]

Wikipedia's favicon, shown in an older version of Firefox (from 2008).

History[edit]

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 side effect no longer works, as all modern browsers support the favicon without bookmarking.[6]

Standardization[edit]

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 XHTML1.0 recommendation, released in January 2000.[8][9] The standard implementation uses a link element with a rel attribute in the <head> section of the document to specify the file format and file name and location. Unlike in the prior scheme, the file can be in any Web site directory and have any image file format.[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] Ironically, when using the .ico format to display as images (e.g. not as favicon), Internet Explorer cannot display files served with this 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 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> 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 have a meaning in this context.

Legacy[edit]

Internet Explorer 5-10 supports only the ICO file formatNetscape 7 and Internet Explorer versions 5 and 6 browsers display the favicon only when the page is bookmarked, and not simply when the page is visited as in later browsers.[4]

Browser implementation[edit]

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

File format support[edit]

The following table illustrates the image file format support for the favicon.
BrowserICOPNGGIFanimated GIFsJPEGAPNGSVG
Firefox1.0[17]1.0[17]1.0[17]YesYes3.0No[18]
Google ChromeYesYes4.04.04.0No?
Internet Explorer5.0[19]11.0[20]11.0[20]No[19]No[19]No[19]No[19]
Opera7.0[21]7.0[21]7.0[21]7.0[21]7.0[21]9.5?
SafariYes4.04.0No4.0NoNo
Additionally, such icon files can be 16×16, 32×32, 48×48, or 64×64 pixels in size, and 8-bit, 24-bit, or 32-bit in color depth.[1][3] The ICO file format article explains the details for icons with more than 256 colors on various Microsoft Windows platforms.

Use of favicon[edit]

This table illustrates the different possibilities where favicons can be displayed.
BrowserAddress barAddress bar drop down listLinks barBookmarksTabsDrag to desktop
Firefox1.0–12.0: Yes[22]
> v13: No[23]
YesYesYes[22]Yes[22]Yes[22]
Google ChromeNo[22]NoYes[22]Yes[22]1.0[22]1.0[24]
Internet Explorer7.0[22]No5.0[22]5.0[22]7.0[22]5.0[22]
Opera7.0[22]No7.0[22]7.0[22]7.0[22]7.0[22]
SafariYes[22]NoNo[22]Yes[22]No[22]No[22]

Wikipedia's favicon, shown inOpera

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

How to use[edit]

This table illustrates the different ways the favicon can be recognized by the web browser.
Google ChromeInternet ExplorerFirefoxOperaSafari
<link rel="shortcut icon"
 href="http://example.com/myicon.ico" />
Yes[4]Yes[4][19]Yes[4]Yes[4]Yes
<link rel="icon"
 href="http://example.com/image.ico" />
YesYes (from IE 11)[20]YesYesYes
<link rel="icon"
 type="image/vnd.microsoft.icon"
 href="http://example.com/image.ico" />
YesYes (from IE 9)[20]YesYesYes
<link rel="icon" type="image/png"
 href="http://example.com/image.png" />
YesYes (from IE 11)[20]YesYesYes
<link rel="icon" type="image/gif"
 href="http://example.com/image.gif" />
YesYes (from IE 11)[20]YesYesYes
<link rel="icon" type="image/x-icon"
href="http://example.com/image.ico"/>
Yes[4]Yes (from IE 9)[26]Yes[4]Yes[4]Yes
favicon.ico located in the website's rootYesYesOptional[27]Optional[28]Yes
precedence: prefer root or (X)HTML linked versionlinked[22]linked[22]linked[22]??
If links for both PNG and ICO favicons are present, PNG-favicon-compatible browsers select which format and size to use as follows. Firefox and Safari will use the favicon that comes last. Chrome for Mac will use whichever favicon is ICO formatted, otherwise the 32×32 favicon. Chrome for Windows will use the favicon that comes first if it is 16×16, otherwise the ICO. If none of the aforementioned options are available, both Chromes will use whichever favicon comes first, exactly the opposite of Firefox and Safari. Indeed, Chrome for Mac will ignore the 16×16 favicon and use the 32×32 version if only to scale it back down to 16×16 on non-retina devices. Opera will choose from any of the available icons completely at random.[29]
Only SeaMonkey doesn’t fetch favicon.ico files in the web site’s root by default.[30]

Device support[edit]

For Apple devices with the iOS operating system version 1.1.3 or later, such as the iPod TouchiPhone, and iPad, as well as some Android devices,[31] it is possible to 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).[32][33] 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.[34]
The recommended basic size for this icon is 60×60 pixels, with 90-degree corners; for best display on the higher-resolution iPhone 4 screen, an icon size of 120×120 pixels is recommended.[33][35][36]
For the iPad and iPad 2, the basic size is 76×76 pixels with 90-degree corners. For the third-generation iPad, the high-resolution size would be 152×152 pixels.[37]
The icon file referenced by apple-touch-icon is modified to add rounded corners, drop shadow, and reflective shine.[33] Alternatively, an apple-touch-icon-precomposed icon may be provided to instruct devices not to apply reflective shine on the image.[33][34]
With rounded corners, reflective shine
<link rel="apple-touch-icon" href="somepath/image.png" />
Without 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.[34] 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.[33][34]

HTML5 recommendation for icons in multiple sizes[edit]

The current HTML5 specification recommends specifying size icons in multiple sizes using the attributes rel="icon" sizes="space-separated list of icon dimensions" within a <link> tag.[38] Multiple icon formats, including container formats such as Microsoft .ico and Macintosh .icns files, as well as Scalable Vector Graphics may be provided by including the icon's content type in the form of type="file content-type" within the <link> tag.
Apple mobile devices running iOS 5 and above ignore the HTML5 recommendation and use the proprietary apple-touch-icon method detailed above. The Google Chrome web browser however, will select the closest matching size from those provided in the HTML headers to create 128×128 pixel application icons when the user chooses the Create application shortcuts... from the "Tools" menu.

Limitations and criticism[edit]

Due to the need to always check for it in a fixed location, the favicon can lead to artificially slow page-load time and garbage 404 entries in the server log if it is nonexistent.[6]
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][19]
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 he or she is securely connected to the proper website. Automated man-in-the-middle attack tools such as SSLStrip utilize this trick.[39] In order to eliminate this, some web browsers display the favicon within the tab whilst displaying the security status of the protocol used to access the website beside the URL.[40]