[Greasemonkey] automate with Firefox?

Mark Spink dmspink at aria.uklinux.net
Wed Jul 6 18:22:59 EDT 2005

On Wed, 2005-07-06 at 08:32 -0700, Aaron Boodman wrote:
> It could also just visually navigate you to the correct pages and
> perform the action. Not only would this look cool, it would take care
> off all the status stuff for you.
> switch (location.href) {
>   page1: 
>     fill in un/pwd
>     submit
>     break;
>   page 2:
>     make comment
>     submit
>     break;
>   etc...
> }

There are a couple off problems with this method

1) not all sites have unique URLs for each page so location.href for
page1 is the same as page2! so you need a method to identify each page
from some other information.

2) you need a function that verifies that the next page has loaded and
not the page you just left. For instance in the example above if the
user name or password was incorrect then instead of page2, page1 will
load again and then loop forever continuously filling in the un/pwd and

If your going to produce some automation script you also don't want it
to execute every time visit the site. What you need is "run script now"

> On 7/6/05, Jeremy Dunck <jdunck at gmail.com> wrote:
> > On 7/6/05, Jason Green <jason at everydayjones.com> wrote:
> > > Since there is a script to automatically log you into MySpace, is it
> > > possible to write something that would then automate tasks? Example,
> > > it'd log into myspace and leave a text message in each of the friends
> > > comment box.
> > 
> > I don't see why not.  You'd probably have to do some clever stuff..
> > Like have a script per task, and have a stored value which you'd use
> > to determine whether to do your automated task.
> > 
> > So say you wanted to post a comment to a list of users once per day.
> > 
> > You could have a script w/ a list of user names and, upon reaching the
> > post-login page, you could check a value to see if it's been a day
> > since last posts.  If so, do async posts w/ xmlhttprequest, and then
> > set the value.  Displaying a completion status would also be nice.  :)
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
This is an email from Key Electronics Ltd. The contents of this email
are intended for the addressee only. No-one else may copy, disseminate
or forward all or part of this email in any form.

This email expresses the views of the sender and not those necessarily
of Key Electronics Ltd or its clients. No-one should place any reliance
on the contents of this e-mail. Key Electronics and it's clients will
not be held responsible for any damages resulting from use of
information in this email.

If you received this email in error please accept our apology. If this
is the case we would be obliged if you would contact the sender and then
delete the e-mail.

If you are not willing to accept the terms and conditions of receiving
this email, please delete it and disregard the contents.

Key Electronics Ltd, PO Box 406, HX3 8YN, Tel:01422 204010

More information about the Greasemonkey mailing list