document.addEventListener('click', event => {
if (!event.isTrusted) {
console.log('Ку-ку')
return;
} else {
console.log('В руку =)')
}
});
const event = new CustomEvent('click', {bubbles: true, cancelable: true});
document.dispatchEvent(event);
// Ку-ку
document.body.click();
// Ку-ку