Skip to content

Instantly share code, notes, and snippets.

@chrisbrownie
Created November 4, 2016 05:19
Show Gist options
  • Save chrisbrownie/791160bc428b962666c58a8a34313886 to your computer and use it in GitHub Desktop.
Save chrisbrownie/791160bc428b962666c58a8a34313886 to your computer and use it in GitHub Desktop.
// From https://gist.github.com/mathiasbynens/428626
document.head || (document.head = document.getElementsByTagName('head')[0]);
function changeFavicon(src) {
var link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.href = src;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
}
changeFavicon('/adfs/portal/logo/favicon.ico');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment