Dear Chris,
thank you so far.
If you could help me with the code it would be great.
I can't seem to figure out when it triggers, with what website or does
it always do it?
What I now use is a bookmark, which is the following code:
javascript:document.getElementsByName('submit')[0].click();
So what you basically say is that this should be in the clickOkButton
section and then the eventlistener?
Is it possible to only activate the script when a webpage includes
try=confirm?
I know.. a lot of questions but I couldn't really find it. Tried
google but all but the answers popped up.
I have no idea how much work it is, but if you could, can you set out
the code and explain why you use certain coding?
Thank you!
P.S. It is for a friend of mine who has RSI. This will help him to
skip the submit sections.
On 1 jul, 01:42, "LWChris@LyricWiki" <[email protected]> wrote:
> Am 30.06.2011 20:15, schrieb Rudy:
>
>
>
>
>
>
>
>
>
> > Dear forumusers,
>
> > As a beginning scripter I'd like some help with the following:
>
> > For a certain website I'm trying to develop a userscript that presses
> > the OK button when a page with the requirements is loaded.
> > This has to be 'timed', only 5 OK presses are allowed per second and
> > it takes about 2 seconds before each page is loaded.
> > The pages useually are opened in seperate tabs and triggerd after each
> > other.
>
> > Is this possible or shouldn't I even start thinking about this?
> > If it is possible, do you have any feed so I can try to figure this
> > one out?
>
> > Thank you!
>
> > .Rudy
>
> Hi Rudy,
> maybe you want this code as draft:
>
> ClickOKButton = function () {
> var Button = document.querySelector();
> Button.click();}
>
> window.addEventListener("load",setTimeout(ClickOkButton,2000),false);
>
> With this code, a timeout of 2 seconds will be triggered as soon as the
> page is ready with loading. After the timeout, the function
> "ClickOKButton" is called, which gets the button element as a variable
> and simulates a click on it. For the explicit usage of querySelector,
> setTimeout and EventListeners use Google or any site you prefer. It did
> not sound like you wanted some ready-to-use script with a complete
> explanation.
>
> Also,
> readhttp://wiki.greasespot.net/Avoid_Common_Pitfalls_in_Greasemonkeybecause
> your script uses setTimeout which does not work the way it's commonly
> used ;)
>
> Chris
>
> N. B.: This script sounds like something for Facebook and Co. If you
> haven't already found it anyway, you may be interested in
> userscripts.org, a huge online repository for userscripts. Maybe the one
> you need is already there just waiting for you to install it within a
> search and 3 clicks.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.