Skip to content

Instantly share code, notes, and snippets.

@public
Created February 25, 2013 14:55
Show Gist options
  • Save public/5030334 to your computer and use it in GitHub Desktop.
Save public/5030334 to your computer and use it in GitHub Desktop.
Stop GIF animations bookmarklet
javascript:function%20is_gif%28e%29%7Breturn/%5E(?!data:).*\.gif/i.test(e.src)}function%20stopgif(e){var%20t=document.createElement(%22canvas%22);var%20n=t.width=e.width;var%20r=t.height=e.height;t.getContext(%222d%22).drawImage(e,0,0,n,r);try{e.src=t.toDataURL(%22image/gif%22)}catch(i){for(var%20s=0,o;o=e.attributes[s];s++)t.setAttribute(o.name,o.value);e.parentNode.replaceChild(t,e)}}[].slice.apply(document.images).filter(is_gif).map(stopgif)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment