Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Auto-unsubscribe on Unroll.me
var i = 0;
function unroll_me_unsubscribe() {
// Bail if share modal (indicating free limit reached) is encountered.
if ( jQuery( '#fb-root' ).length > 0 ) { return; }
var unsub_link = jQuery( '.LetterList a.uicon-set-unsubscribe:first' );
if ( unsub_link.length > 0 ) {
document.getElementById( unsub_link.attr( 'id' ) ).click();
if ( i++ < 6000 ) { /* Upper limit in case something goes wrong. */
setTimeout( unroll_me_unsubscribe, 1500 );
}
}
}
unroll_me_unsubscribe();
@mig
Copy link

mig commented Aug 9, 2015

Thank you for this! Worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment