Skip to content

Instantly share code, notes, and snippets.

@spite
Created February 20, 2018 18:02
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
document.body.addEventListener('click', async e => {
if(e.srcElement && e.srcElement.classList.contains('irc_mi')) {
const downloadBtn = document.createElement( 'a' );
downloadBtn.setAttribute( 'target', '_blank' );
downloadBtn.setAttribute( 'href', e.srcElement.src );
downloadBtn.click();
e.preventDefault();
e.stopPropagation();
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment