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
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
As far as I know, that no longer includes MozRepl, except maybe for
some non-fundamental bits...
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
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