I was wondering if its possible to trigger a click event with isTrusted being true, i found out how to trigger a click event but i couldn't find any answers on how to set isTrusted as true
function click(x, y)
{
var ev = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': true,
'screenX': x,
'screenY': y
});
var el = document.elementFromPoint(x, y);
console.log(el); //print element to console
el.dispatchEvent(ev);
}
click(255, 600);
Here is the code that i used to trigger a normal click with isTrusted being false