Skip to content

Instantly share code, notes, and snippets.

@ozh
Created May 4, 2014 20:40
Show Gist options
  • Save ozh/f1ba37bec48e63fa7079 to your computer and use it in GitHub Desktop.
Save ozh/f1ba37bec48e63fa7079 to your computer and use it in GitHub Desktop.
Most standard ways to get a favicon from a page

Most standard ways to get a favicon from a page, in preferred order

In file:

  • <link href="http://someserver/favicon.ico" rel="shortcut icon" />
  • <link href="http://someserver/favicon.ico" rel="shortcut" />
  • <link href="http://someserver/favicon.ico" rel="icon" />
  • <link href="http://someserver/favicon.png" rel="apple-touch-icon" />
  • <link href="http://someserver/favicon.png" rel="apple-touch-icon-precomposed" />
  • <link href="http://someserver/favicon.ico" rel="image_src" />

Don't forget to match arbitrary orders of attributes, eg

  • <link rel="apple-touch-icon" sizes="72x72" href="apple.png" />

File at root:

  • Current dir: http://someserver/directory/favicon.ico
  • Root dir: http://someserver/favicon.ico

Social stuff:

  • <meta content="http://someserver/favicon.ico" itemprop="image" />
  • <meta content="http://someserver/favicon.ico" property="og:image" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment