B
B
Buytr2020-06-10 04:19:10
JavaScript
Buytr, 2020-06-10 04:19:10

How to fix TypeError: Cannot read property 'firesTouchEvents' of null?

I'm trying to create a bot for a browser game and when I click on one of the buttons, this error pops up, although if I click on any other button, everything works fine. Is it possible that some protection is worth it? This bot is created as a browser snippet.

var button2 = document.getElementsByClassName('_action');

button2[0].click()


Button code Error: VM4332:6 TypeError: Cannot read property 'firesTouchEvents' of null at :1:72243 at MouseEvent.a.action (:1:72511) at action (eval at ((index):1), :1: 11062) at click (eval at Ya ((index):1), :3:1158) at He (:6:11384) at HTMLDivElement.n (:6:13168) at HTMLDivElement.Yr.o._wrapper (:6 :48505) at VM6707 Script snippet %232:3 I found this method, but it's not clear how to attach it to my code:
<div class="_action">Кнопка</div>


var buttons = $('form').eq(0).find('button');
    for (var index = 0; index < buttons.length; ++index) {
      if(buttons.eq(index).css('display') == "inline-block") {
        buttons.eq(index).mouseenter();
        buttons.eq(index).click();
        return true;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question