Google Grupper støtter ikke lenger nye Usenet-innlegg eller -abonnementer. Historisk innhold er fortsatt synlig.

is there a BrowserInitialized event?

Sett 7 ganger
Hopp til første uleste melding

Alex Iskold

ulest,
19. nov. 2006, 18:20:0619.11.2006
til
Hi,

We are having issues on browser init. Is there an event that we can get
once browser is fully initialized?

Thanks in advance,

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com

mark bokil

ulest,
19. nov. 2006, 18:27:1419.11.2006
til dev-ext...@lists.mozilla.org
Alex Iskold wrote:
> Hi,
>
> We are having issues on browser init. Is there an event that we can get
> once browser is fully initialized?
>
> Thanks in advance,
>
> Alex
>
>
I usually use the strategy of attaching an init script to the
window.onload event:
<script type="application/x-javascript">
<![CDATA[
window.addEventListener('load', MyFunction.init, false);
]]>
</script>

Alex Iskold

ulest,
19. nov. 2006, 18:51:5219.11.2006
til
Thanks. it appears that there are problems with doing this Mark.
As not all the browser functions are available. For example, adding a tab
from
this thread causes problems.

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com


"mark bokil" <ma...@markbokil.org> wrote in message
news:mailman.1294.11639790...@lists.mozilla.org...

mark bokil

ulest,
19. nov. 2006, 19:17:0919.11.2006
til dev-ext...@lists.mozilla.org
Alex Iskold wrote:
> Thanks. it appears that there are problems with doing this Mark.
> As not all the browser functions are available. For example, adding a tab
> from
> this thread causes problems.
>
> Alex
>
>
For tabs I usually attach a listener to the tab container:
//attach listener to new tab in seamonkey brower
container = gBrowser.mPanelContainer;
container.addEventListener("DOMNodeInserted",
MyFunction.processPage, true);

Nickolay Ponomarev

ulest,
19. nov. 2006, 20:25:2319.11.2006
til Alex Iskold, dev-ext...@lists.mozilla.org
On 11/20/06, Alex Iskold <alex....@adaptiveblue.com> wrote:
> Thanks. it appears that there are problems with doing this Mark.
> As not all the browser functions are available.

There's also delayedStartup() function that should finish any
initialization. It doesn't dispatch events though.

> For example, adding a tab
> from
> this thread causes problems.
>

This sounds like a bug, at least a documentation one.

Nickolay


> Alex
>
> --
> alex iskold
> founder & cto
> http://www.adaptiveblue.com
>
>
> "mark bokil" <ma...@markbokil.org> wrote in message
> news:mailman.1294.11639790...@lists.mozilla.org...
> > Alex Iskold wrote:
> >> Hi,
> >>
> >> We are having issues on browser init. Is there an event that we can get
> >> once browser is fully initialized?
> >>
> >> Thanks in advance,
> >>
> >> Alex
> >>
> >>
> > I usually use the strategy of attaching an init script to the
> > window.onload event:
> > <script type="application/x-javascript">
> > <![CDATA[
> > window.addEventListener('load', MyFunction.init, false); ]]>
> > </script>
>
>

> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>

Eric Shepherd

ulest,
19. nov. 2006, 20:26:4719.11.2006
til Nickolay Ponomarev, dev-ext...@lists.mozilla.org, Alex Iskold
I filed a bug once asking for an event that would be sent after the
browser window is completely done setting up, including loading any
stored tabs that are being pulled up in it. I don't recall the
number or its status offhand though.


Eric Shepherd
Developer Documentation Lead
she...@mozilla.com

Alex Iskold

ulest,
19. nov. 2006, 20:34:2519.11.2006
til
My observation is:

As the number of extensions increases - or -
As some extensions take longer to initialize

Some of the functions that we are trying to perform after we are invoked
like calling openTab fail. This leads me to think that code is something
like this:


browser.init {
doPreAddOnStuff();
foreach add-on in list of add-ons do {
add-on.notifyWindowLoad( ); <------- Synchronous call
}
doPostAddOnStuff();
}

so if in my add on, i use callLater( timeout ), where timeout is small
it is possible that [doPostAddOnStuff] has not been done.

Is it possible?

Thanks!

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com


"Eric Shepherd" <eshe...@mozilla.com> wrote in message
news:mailman.1301.11639860...@lists.mozilla.org...

Alex Iskold

ulest,
19. nov. 2006, 20:36:2119.11.2006
til
p.s. Specifically, we are trying to add a button to the toolbar,
and so we see this:

browser.js: 3059 - TypeError: gGobuttonPrefListener has no properties

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com


"Alex Iskold" <alex....@adaptiveblue.com> wrote in message
news:f6SdnSF81o6_m_zY...@mozilla.org...

Eric H. Jung

ulest,
19. nov. 2006, 20:43:4619.11.2006
til dev-extensions
What's wrong with using an app-startup observer?

My observation is:

Is it possible?

Thanks!

Alex

_______________________________________________
dev-extensions mailing list
dev-ext...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions


____________________________________________________________________________________
Sponsored Link

Mortgage rates near 39yr lows.
$310k for $999/mo. Calculate new payment!
www.LowerMyBills.com/lre

Alex Iskold

ulest,
19. nov. 2006, 20:48:4419.11.2006
til
Is there an example of how to use the "app-startup" observer?

Thanks,

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com


"Eric H. Jung" <eric...@yahoo.com> wrote in message
news:mailman.1302.11639870...@lists.mozilla.org...

mark bokil

ulest,
19. nov. 2006, 22:56:5419.11.2006
til dev-ext...@lists.mozilla.org
Alex Iskold wrote:
> My observation is:
>
> As the number of extensions increases - or -
> As some extensions take longer to initialize
>
>
You are right about this I think. I have an extension that onload sets
the browser window to fullscreen. I found that if it was called directly
from onload it failed to run. The various initialization scripts in the
browser and other extensions had not finished. My solution was to set a
window.onload event to point to a setTimeout function delayed by 100. It
is a hack but I haven't had it fail yet. Possibly try a timer and see if
it works.

Alex Iskold

ulest,
20. nov. 2006, 00:23:0120.11.2006
til
Tried that too. We use MochiKit, so I did callLater.
It works sometimes, but 100 mls is too short. We have
users with... I kid you not... > 120 extensions :)

--
alex iskold
founder & cto
http://www.adaptiveblue.com

"mark bokil" <ma...@markbokil.org> wrote in message

news:mailman.1303.11639952...@lists.mozilla.org...

mark bokil

ulest,
20. nov. 2006, 04:50:5820.11.2006
til dev-ext...@lists.mozilla.org
Alex Iskold wrote:
> Tried that too. We use MochiKit, so I did callLater.
> It works sometimes, but 100 mls is too short. We have
> users with... I kid you not... > 120 extensions :)
>
>
I believe it. For a long time I tried to remind people that each new
extension could possibly destabilize the browser. Usually people figure
it out on their own when they add the 121st extension and Firefox
starts behaving erratically. Sometimes I think there should be a
recommended use posting on the download site that suggests limiting
extensions to no more than 10.

Nickolay Ponomarev

ulest,
20. nov. 2006, 05:11:5820.11.2006
til Eric H. Jung, dev-extensions
That it's a application wide notification, so it can't tell you when
the chrome for a particular window is fully initialized.
Nickolay

On 11/20/06, Eric H. Jung <eric...@yahoo.com> wrote:
> What's wrong with using an app-startup observer?
>
>
> ----- Original Message ----
> From: Alex Iskold <alex....@adaptiveblue.com>
> To: dev-ext...@lists.mozilla.org
> Sent: Sunday, November 19, 2006 8:34:25 PM
> Subject: Re: is there a BrowserInitialized event?
>

> My observation is:
>
> As the number of extensions increases - or -
> As some extensions take longer to initialize
>

> Some of the functions that we are trying to perform after we are invoked
> like calling openTab fail. This leads me to think that code is something
> like this:
>
>
> browser.init {
> doPreAddOnStuff();
> foreach add-on in list of add-ons do {
> add-on.notifyWindowLoad( ); <------- Synchronous call
> }
> doPostAddOnStuff();
> }
>
> so if in my add on, i use callLater( timeout ), where timeout is small
> it is possible that [doPostAddOnStuff] has not been done.
>
> Is it possible?
>
> Thanks!
>
> Alex
>

> --
> alex iskold
> founder & cto
> http://www.adaptiveblue.com
>
>

Alex Iskold

ulest,
20. nov. 2006, 09:25:1020.11.2006
til
agree, good point.

we probably also want to have a compatibility matrix.

have you seen the [Restart button] misbehaving?

Alex

--
alex iskold
founder & cto
http://www.adaptiveblue.com


"mark bokil" <ma...@markbokil.org> wrote in message

news:mailman.1309.11640164...@lists.mozilla.org...

0 nye meldinger