FF.au3 / AutoIt to FireFox connector

2,348 views
Skip to first unread message

Stilgar

unread,
Feb 9, 2009, 7:03:29 AM2/9/09
to MozLab
For anyone using AutoIt - I've created a AutoIt-function library
(FF.au3) using MozRepl:
http://www.thorsten-willert.de/Themen/AutoIt-FF.au3/

With it you can load webpages, fill forms, perform actions ... - you
can do anything with it, what you can do inside MozRepl, too.

Andres Riancho

unread,
Feb 9, 2009, 7:44:39 AM2/9/09
to moz...@googlegroups.com
List,
I like the _FFLoadWait [0] function; is there something like that in mozlab?

[0] http://translate.google.de/translate?u=http%3A%2F%2Fthorsten-willert.de%2FThemen%2FAutoIt-FF.au3%2FDokumentation%2C%2520German%2Findex.html&sl=de&tl=en&hl=de&ie=UTF-8

> >
>



--
Andres Riancho
http://w3af.sourceforge.net/
Web Application Attack and Audit Framework

Stilgar

unread,
Feb 9, 2009, 9:10:55 AM2/9/09
to MozLab
The only thing I do in the function _FFLoadWait, is to check in a loop
if the value of:

document.getElementById('statusbar-icon').value

is 100, but I don't know if there is something like that on MozLab /
MozRepl or any other (simple) alternative.

On 9 Feb., 13:44, Andres Riancho <andres.rian...@gmail.com> wrote:
> List,
>
> On Mon, Feb 9, 2009 at 10:03 AM, Stilgar <thorsten.will...@gmx.de> wrote:
>
> > For anyone using AutoIt - I've created a AutoIt-function library
> > (FF.au3) using MozRepl:
> >http://www.thorsten-willert.de/Themen/AutoIt-FF.au3/
>
> > With it you can load webpages, fill forms, perform actions ... - you
> > can do anything with it, what you can do inside MozRepl, too.
>
> I like the _FFLoadWait [0] function; is there something like that in mozlab?
>
> [0]http://translate.google.de/translate?u=http%3A%2F%2Fthorsten-willert....
>
>
>
> --
> Andres Rianchohttp://w3af.sourceforge.net/

Andres Riancho

unread,
Feb 9, 2009, 10:04:47 AM2/9/09
to moz...@googlegroups.com
Stilgar,

That's one nice hack :)
--
Andres Riancho

Leonid Evdokimov

unread,
Feb 9, 2009, 10:14:14 AM2/9/09
to moz...@googlegroups.com
Stilgar wrote:
> I don't know if there is something like that on MozLab / MozRepl or
> any other (simple) alternative.

What's wrong with:
window.getBrowser().addEventListener("load", callback, false);

I use it in screenshot saver [1] and it works good enough for me.


[1] http://darkk.net.ru/omsucren/ScreenshotSaver.js

--
WBRBW, Leonid Evdokimov

signature.asc

Andres Riancho

unread,
Feb 10, 2009, 2:36:26 PM2/10/09
to moz...@googlegroups.com
Leonid,

On Mon, Feb 9, 2009 at 1:14 PM, Leonid Evdokimov <le...@darkk.net.ru> wrote:
> Stilgar wrote:
>> I don't know if there is something like that on MozLab / MozRepl or
>> any other (simple) alternative.
>
> What's wrong with:
> window.getBrowser().addEventListener("load", callback, false);

I'll tell you what's wrong with that:

- it's not documented
- it's harder to remember than one nice function like FFLoadWait

> I use it in screenshot saver [1] and it works good enough for me.
>
>
> [1] http://darkk.net.ru/omsucren/ScreenshotSaver.js

I get a 404 error message.

Don't get me wrong, I like the power that mozlab gives me, but a lot
of features are poorly documented and they require a lot of time for
new users to figure out. It's like Assembler, you can do everything
with it, but learning how to takes ages; that's why Python was
invented ;) ;)

Cheers,

> --
> WBRBW, Leonid Evdokimov
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkmQSEYACgkQbNKln9z6vVwEfQCfUnjXjDDas/TD4AeZ4UCmQusb
> /gMAnAo988h65M7DzbeHqJwAd3ZgrrCc
> =HWGd
> -----END PGP SIGNATURE-----
>
>

--
Andres Riancho

Massimiliano Mirra

unread,
Feb 10, 2009, 2:43:02 PM2/10/09
to moz...@googlegroups.com
Stilgar, and everybody building cool things on top of my little hack,
feel free to link them from MozRepl wiki page at
http://wiki.github.com/bard/mozrepl under "Related work". I do my
best at keeping track of stuff but that's rarely enough.

-m

Andres Riancho

unread,
Feb 10, 2009, 2:52:20 PM2/10/09
to moz...@googlegroups.com
Massimiliano,

On Tue, Feb 10, 2009 at 5:43 PM, Massimiliano Mirra
<hyper...@gmail.com> wrote:
>
> Stilgar, and everybody building cool things on top of my little hack,
> feel free to link them from MozRepl wiki page at
> http://wiki.github.com/bard/mozrepl under "Related work". I do my
> best at keeping track of stuff but that's rarely enough.

You may be interested in this:

http://code.google.com/p/jsbridge/
http://code.google.com/p/jsbridge/wiki/UsingJSBridge

> -m
>
> On Mon, Feb 9, 2009 at 1:03 PM, Stilgar <thorsten...@gmx.de> wrote:
>>
>> For anyone using AutoIt - I've created a AutoIt-function library
>> (FF.au3) using MozRepl:
>> http://www.thorsten-willert.de/Themen/AutoIt-FF.au3/
>>
>> With it you can load webpages, fill forms, perform actions ... - you
>> can do anything with it, what you can do inside MozRepl, too.
>> >
>>
>
> >
>



Massimiliano Mirra

unread,
Feb 10, 2009, 7:36:49 PM2/10/09
to moz...@googlegroups.com
>> Stilgar, and everybody building cool things on top of my little hack,
>> feel free to link them from MozRepl wiki page at
>> http://wiki.github.com/bard/mozrepl under "Related work". I do my
>> best at keeping track of stuff but that's rarely enough.
>
> You may be interested in this:
>
> http://code.google.com/p/jsbridge/
> http://code.google.com/p/jsbridge/wiki/UsingJSBridge

As far as I know, that no longer includes MozRepl, except maybe for
some non-fundamental bits...

Leonid Evdokimov

unread,
Feb 10, 2009, 2:53:00 PM2/10/09
to moz...@googlegroups.com
Andres Riancho wrote:
>> What's wrong with:
>> window.getBrowser().addEventListener("load", callback, false);
>
> I'll tell you what's wrong with that:
> - it's not documented

It's documented in mozilla knowledge base, but I agree that mozilla
documentation may be hard to understand, I spent much more then 15
minutes to get right event at right time and process it in right way and
I'm still unsure that code is really correct :-)


> - it's harder to remember than one nice function like FFLoadWait

I agree, libraries are cool, there is only one note — one should never
mix libraries with core or php will be born instead of python. ;)

Also, polling and testing for icon name is definitely imperfect
implementation, callback looks like better one.


> I get a 404 error message.

Oops, right link was http://darkk.net.ru/omsucreen/ScreenshotSaver.js

--
WBRBW, Leonid Evdokimov

signature.asc

Stilgar

unread,
Feb 11, 2009, 3:43:24 AM2/11/09
to MozLab
Yes I know the testing with:
document.getElementById('statusbar-icon').value
is imperfect, but that is what they do in FireFox as I looked through
the FF source code (Browser.js), I hope they know what they do :D

And searching such things like:

window.getBrowser().addEventListener("load", callback, false);

on https://developer.mozilla.org/En
takes sometimes hours and the most things are without any example :(

If there any I can't use anything because then I have to much
communication between AutoIt and MozRepl, that takes to much time, to
send a command to MozRepl, wait for answer, check for errors ... OK I
send many "bigger" functions to FF at start at the communication, but
for everything I must poll the results.
> Oops, right link washttp://darkk.net.ru/omsucreen/ScreenshotSaver.js
>
> --
> WBRBW, Leonid Evdokimov
>
>  signature.asc
> < 1 KBAnzeigenHerunterladen

Leonid Evdokimov

unread,
Feb 11, 2009, 3:57:47 AM2/11/09
to moz...@googlegroups.com
Stilgar wrote:
> And searching such things like:
> window.getBrowser().addEventListener("load", callback, false);
> on https://developer.mozilla.org/En
> takes sometimes hours and the most things are without any example :(

I agree, in fact it's the only reason I posted it here, hope, it'll save
a hour or two for someone else.

Callback is just much more "javascriptish" way than polling as there are
no native threads in JS and AJAX works in this way.

--
WBRBW, Leonid Evdokimov

signature.asc

Stilgar

unread,
Feb 20, 2009, 10:52:35 AM2/20/09
to MozLab
I used now for the _FFLoadWait the nsIWebProgress interface instead of
any event listener or the document.getElementById('statusbar-
icon').value.

The "load" listender is useless to check if a site is complet loaded,
it's fired when a site "begins" to load. If you wanna do this with an
event you must use this events:
https://developer.mozilla.org/en/Gecko-Specific_DOM_Events


On 11 Feb., 09:57, Leonid Evdokimov <l...@darkk.net.ru> wrote:
> Stilgar wrote:
> > And searching such things like:
> > window.getBrowser().addEventListener("load", callback, false);
> > onhttps://developer.mozilla.org/En
> > takes sometimes hours and the most things are without any example :(
>
> I agree, in fact it's the only reason I posted it here, hope, it'll save
> a hour or two for someone else.
>
> Callback is just much more "javascriptish" way than polling as there are
> no native threads in JS and AJAX works in this way.
>
> --
> WBRBW, Leonid Evdokimov
>
>  signature.asc
> < 1 KBAnzeigenHerunterladen
Reply all
Reply to author
Forward
0 new messages