( function( $, mw ) {
	mw.hook( 'AutoFormatterDoneWithChange' ).add( function() {
		var selectors = [
			'#enhanced-diff-live-button',
			'.schnark-diff-button-new',
			'#wpDiff'
		];

		for ( i in selectors ) {
			var $button = $( selectors ).first();

			if ( $button.length ) {
				$button.click();
				break;
			}
		}
	} );
} )( jQuery, mediaWiki );