Detect synthetic clicks on a webpage

前端 未结 6 1453
谎友^
谎友^ 2021-01-15 19:51

Through Javascript is it possible to detect synthetic clicks (the clicks that were not generated by human but instead was generated using JS or some other automation tool) ?

6条回答
  •  有刺的猬
    2021-01-15 20:02

    I realize this question is old but the correct way is to use event.isTrusted which will be true if user clicked with mouse or false if it was dispatched by a script.

提交回复
热议问题