<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(e){
setInterval(function(){
var myElement = document.querySelector(".button")
myElement.click()
}, 4000)
})
</script>
if (window.CustomEvent) {
const myElement = document.querySelector(".button")
const middleClick = new MouseEvent("click", { "button": 1, "which": 1 });
myElement.dispatchEvent(middleClick);
}