Custom event, 2 clicks at a time

1. The custom event triggers the click event of .cpcstartrefresh, but triggers 2 click events each time

2. The code is as follows:
window.onmessage = function (e) {
/ / create an event object,

    var myEvent = document.createEvent("Event");
    myEvent.initEvent("click", false, false);
    e = e || event;
    e.eventType = "message";
    if (e.data === "returnfromsht") {
         console.log(e.data, "returnfromsht4");
         
         //2
         document.getElementsByClassName("cpcstartrefresh")[0].dispatchEvent(myEvent);
         
    } else if (e.data === "maximumwindow") {
        console.log(e.data, "maximumwindow");
    }
};
Feb.26,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e78cab-464bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e78cab-464bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?