User:Fred Gandt/addCloneClearButtonAboveScributoConsole.js

$( document ).ready( => {	"use strict";	if ( mw.config.get( "wgAction" ) === "edit" ) {		const SCRIBUNTO_CONSOLE = document.getElementById( "mw-scribunto-console" );		if ( SCRIBUNTO_CONSOLE ) {			const CLEAR_BUTTON = SCRIBUNTO_CONSOLE.querySelector( 'input[type="button"][value="clear"i]' );			if ( CLEAR_BUTTON ) {				const CLEAR_BUTTON_CLONE = CLEAR_BUTTON.cloneNode;				CLEAR_BUTTON_CLONE.addEventListener( "click",  => CLEAR_BUTTON.click, { passive: true } );				SCRIBUNTO_CONSOLE.prepend( CLEAR_BUTTON_CLONE );			}		}	} } );