4

Context

I am working on a JavaScript application that will allow the user to remotely control an HTML+CSS+JS slideshow.

The slideshow is generated by a program that converts it from powerpoint.

Problem

The JavaScript slideware is an obfuscated JS code. However, there are some behaviours I have been able to trigger using jQuery/JS events (e.g., if I call .click() on the next button, the slideshow advances to the next slide).

Anyway, there are some behaviours that are triggered when I click on some elements, but are not triggered when I call jQuery's .click() on the jQuery object corresponding to that element.

My idea

I would like to simulate the actual click over some element, since I don't know exactly what of the events triggered after I click it is the one that makes the desired behaviour possible.

Is that possible? Or, am I missing another approach to solve this problem?

I tried something as in this post, but it won't worked (nothing happened).

More about my specific problem

You can see an example slideshow here. (The slideware is this JS).

The behaviour I want to trigger is what happens when you click on a thumbnail (the ones that you see after clicking on menu). That is, I want to able to jump from one slide to another.

An interesting observation I made is that the slide change is triggered after you raise up the mouse click, and that it works whether you use left or right click.

4

2 に答える 2

2

As someone made me notice in the comments, the reffered answer was right. My mistake was to assume that using jQuery instead of plain JavaScript would work just the same way (it didn't, as jQuery object's are different of DOM elements).

Of course, you could get a DOM element using jQuery, but that is not what I did. (I triggered the events over jQuery's objects and it didn't work).

By the way, if someone stumbles this question looking for how to debug an obfuscated JavaScript, another useful information I found is a tip about using the Google Chrome's debugger for detecting event handlers in the running scripts. This could be useful to see other events different than click.

于 2013-01-03T15:15:18.977 に答える
0

Theres no way to simulate users clicks. The aproach of all frameworks is always trigger envents by javascript/jquery like the $(element).click();

For your particular case maybe can try, some mouse events, to cover all posible cases http://api.jquery.com/category/events/mouse-events/

Other aproach could be, try if is possible simulate the behaivior with selenium.

于 2013-01-03T15:25:23.397 に答える