Answer the question
In order to leave comments, you need to log in
How to determine if a function is called by a user action or not?
Events have a read-only isTrusted property that indicates, for example, whether it was a real mouse click or just triggered this event on an element.
Popup windows are only opened if they are reached by a call chain initiated by a user action, a click.
How is it possible inside any function, without accessing the property of the original event, to find out whether it is now legal to open a new window? Maybe there are some properties/methods of the current context/environment?
Perhaps you can try to create a new window and check the result. But I wonder if it is possible somehow else - is there an analogue of the isTrusted property somewhere in the context?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question