General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Simulate click
Posted by: happyuser
Date: November 08, 2011 04: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 !

Options: ReplyQuote
Re: Simulate click
Posted by: JamesD
Date: November 08, 2011 07:12PM

I cannot recall any method for that in the MacroLanguage.

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: Simulate click
Posted by: happyuser
Date: November 09, 2011 12:15AM

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

Hi!

Options: ReplyQuote
Re: Simulate click
Posted by: snuz2
Date: November 09, 2011 06:27AM

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 06:33AM by snuz2.

Options: ReplyQuote
Re: Simulate click
Posted by: JamesD
Date: November 09, 2011 02: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.

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: Simulate click
Posted by: happyuser
Date: November 09, 2011 05:29PM

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!

Options: ReplyQuote
Re: Simulate click
Posted by: JamesD
Date: November 09, 2011 08:23PM

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.

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: Simulate click
Posted by: JohnHell
Date: November 09, 2011 09:52PM

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/09/2011 09:53PM by JohnHell.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.