Simulate click
Posted by: happyuser
Date: November 08, 2011 11:56PM

Hi to all, i am writing my own application using kmeleon. There is a way to simulate a click on a html button with kmeleon macro language or an external plugin?

Thank in advantage !

Re: Simulate click
Posted by: JamesD
Date: November 09, 2011 02:12AM

I cannot recall any method for that in the MacroLanguage.

Re: Simulate click
Posted by: happyuser
Date: November 09, 2011 07:15AM

There is no plugin or something like that? Not possible with kmelon?

Hi!

Re: Simulate click
Posted by: snuz2
Date: November 09, 2011 01:27PM

Possible, but not directly with macro language unless it is something already included in the macro language like popping an alert box or loading a URL. There is a list of actions that are possible on this page.

To add something else to macro language you need to make a chrome extension and run it from macro language or use the injectJS function to do the same thing. essentially it must be run in javascript. unless it's something very short and simple it can become annoying...



Edited 1 time(s). Last edit at 11/09/2011 01:33PM by snuz2.

Re: Simulate click
Posted by: JamesD
Date: November 09, 2011 09:09PM

@ happyuser

How do you propose to tell your application which button to click? Will the user be involved in the choice? Does the user need to read the page prior to the button click? Will it be the same html page or can the page vary?

Sometimes there is more than one way to get an action done. Answers to the above questions may reveal other options.

Re: Simulate click
Posted by: happyuser
Date: November 10, 2011 12:29AM

I have to simulate a button click on an html button.

In that html page there is a button, on this button there is an "onclick" function. I just simply want click this html button, or call the "skipButton() function.
onclick="skipButton()"

How can solve that? Thanks!

Re: Simulate click
Posted by: JamesD
Date: November 10, 2011 03:23AM

Sounds like a job for injectJS() and an OnLoad event, except that injectJS() is to be avoided with event processing. I have no good answer.

Re: Simulate click
Posted by: JohnHell
Date: November 10, 2011 04:52AM

Quote
happyuser
I have to simulate a button click on an html button.

In that html page there is a button, on this button there is an "onclick" function. I just simply want click this html button, or call the "skipButton() function.
onclick="skipButton()"

How can solve that? Thanks!

That, as simple as you tell (the script/function is already in the page), can be done by just calling the function via URL
javascript:skipButton()
. Or, in macro language, a line like
open("javascript:skipButton()");



Edited 1 time(s). Last edit at 11/10/2011 04:53AM by JohnHell.

K-Meleon forum is powered by Phorum.