Event.isTrusted is an attribute that is true when the event was generated by a user action, and false when the event was created or modified by script, or dispatched via dispatchEvent.
Docs: https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted
Samples: https://googlechrome.github.io/samples/event-istrusted/index.html