Last active
January 3, 2018 14:26
-
-
Save spemer/53dd56df57494a7dda5148b42345e53c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setFavicons(favImg){ | |
let headTitle = document.querySelector('head'); | |
let favIcons = [ | |
{ rel: 'apple-touch-icon' }, | |
{ rel: 'apple-touch-startup-image' }, | |
{ rel: 'shortcut icon' } | |
] | |
favIcons.forEach(function(favIcon){ | |
let setFavicon = document.createElement('link'); | |
setFavicon.setAttribute('rel', favIcon.rel); | |
setFavicon.setAttribute('href', favImg); | |
headTitle.appendChild(setFavicon); | |
}); | |
} | |
setFavicons('https://spemer.com/img/favicon/favicon.png'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment