Skip to content

Instantly share code, notes, and snippets.

@VasilSlavchev
Forked from ozh/get_favicon.md
Created October 16, 2019 12:48
Show Gist options
  • Save VasilSlavchev/fc5333e54315dcb08b7fbcdeee2ca65d to your computer and use it in GitHub Desktop.
Save VasilSlavchev/fc5333e54315dcb08b7fbcdeee2ca65d 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