Skip to content

Instantly share code, notes, and snippets.

@bak
Created November 22, 2008 11:26
Show Gist options
  • Save bak/27806 to your computer and use it in GitHub Desktop.
Save bak/27806 to your computer and use it in GitHub Desktop.
Drew McLellan's bookmarklet to insert any png into the DOM of a site as an apple-touch-icon
javascript:var%20links=document.getElementsByTagName('head')[0].getElementsByTagName('link');for(var%20i=0;i%3Clinks.length;i++){if(links[i].getAttribute('rel')=='apple-touch-icon'){links[i].parentNode.removeChild(links[i])}; break;};var%20s=document.createElement('link');s.setAttribute('rel', 'apple-touch-icon');s.setAttribute('href',prompt('Touch icon URL?','http://'));document.getElementsByTagName('head')%5B0%5D.appendChild(s);void(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment