0

I want to trigger the Street Icon on in this browser game. In other games it was easy by using the document.getElementById.

In Firefox the button shows up as jQuery. However if I create an event function nothing happens.

This is what I did, copied the event from inspector into a function and called streetIcon(); in the console.

function streetIcon() {
    function (d) {
        var e = function() {
          g(b, {
            $event: d
          })
        };
        Gg[a] && c.$$phase ? b.$evalAsync(e) : b.$apply(e)
      }
}

However, it doesn't work like with document.getElementById.

Is there a way to trigger buttons div class or so? I feel like I'm doing this wrong so pointing to the correct documentation is much appreciated.

  • So that's a function (e) declared inside an anonymous function, which is declared inside a third function (streetIcon)... I'm not sure there's even a way to trigger this. `streetIcon` doesn't even _return_ the function that's inside (so one could do `streetIcon()()`). But without returning it... scratching my head – Jeremy Thille Jul 08 '21 at 13:49
  • Most examples I found looked different to the event I found. If it's not possible without reverse engineering the game, a hint for an alternative way would be nice. Something that I can run in the console rather than something like pyautogui. edit - I see now this is what others meant with hidden element. – Victor Jouhoff Jul 08 '21 at 13:51
  • 1
    Does this answer your question? [How to simulate a click with JavaScript?](https://stackoverflow.com/questions/2705583/how-to-simulate-a-click-with-javascript) – Heretic Monkey Jul 08 '21 at 14:44

0 Answers0