Skip to content

Instantly share code, notes, and snippets.

@spemer
Last active January 3, 2018 14:27
Show Gist options
  • Save spemer/525f2d1268f398b5b1a6e17b3504e378 to your computer and use it in GitHub Desktop.
Save spemer/525f2d1268f398b5b1a6e17b3504e378 to your computer and use it in GitHub Desktop.
function setAppleFavicons(){
let headTitle = document.querySelector('head');
let appleFavIcons = [
{ sizes:'152x152', href: '../touch-icon-ipad.png' },
{ sizes:'180x180', href: '../touch-icon-iphone-retina.png' },
{ sizes:'167x167', href: '../touch-icon-ipad-retina.png' }
]
appleFavIcons.forEach(function(appleFavIcon){
let setAFavicon= document.createElement('link');
setAFavicon.setAttribute('rel','apple-touch-icon');
setAFavicon.setAttribute('sizes',appleFavIcon.sizes);
setAFavicon.setAttribute('href',appleFavIcon.href);
headTitle.appendChild(setAFavicon);
});
}
setAppleFavicons();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment