question on need to restart browser after installing new extension

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

question on need to restart browser after installing new extension

Pravin-3
Hi,
Following is my understanding, and please correct me if I am wrong
anywere.

As per my understanding mozilla uses plug-in architecture to increase
its functionality at runtime. For this, it uses plugins and extensions
which are in form of  DSO's (Dynamic shared objects) (ie. .so .dll
etc...).
And it uses dlsym() and dlopen() like application programming
interface for dynamic linking loader to activate the DSO's as and when
they are needed.

If this is the way mozilla implements its plug-in architecture then
why do we need to restart the firefox when we install new extension or
update existing extension ?
As programming interface for dynamic linking loader allows you to open
new DSO, close existing DSO and reopen it again with newer version,
then is it not possible to update existing extensions or load new
extensions without restrating the browser ?

Can I know why exactly there is need to restart the browser for new
extensions to get activated ?

Can I get pointers to some documentation or code which deals with how
exactly these new DSO's are loaded and how these newly installed
extensions come to life ?

Regards,
Pravin Shinde

_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question on need to restart browser after installing new extension

Nickolay Ponomarev
On 9/7/07, Pravin <[hidden email]> wrote:
> As per my understanding mozilla uses plug-in architecture to increase
> its functionality at runtime. For this, it uses plugins and extensions
> which are in form of  DSO's (Dynamic shared objects) (ie. .so .dll
> etc...).
> And it uses dlsym() and dlopen() like application programming
> interface for dynamic linking loader to activate the DSO's as and when
> they are needed.
>
That's how plug-ins (like flash) work. AFAIK, they can be used after
installation without restarting the app.

Extensions are more complicated. Most consist of XUL overlays and JS
attached to them, as well as XPCOM components. The XUL overlays modify
the application's UI when applied, and currently they are applied at
the master document's (usually window) load time. While there is now a
way to load XUL overlays dynamically, it doesn't work as well as the
normal load-time overlays.

The JS code in nearly all extensions does some initialization on
application startup or when a window it overlays loads. It's
impossible to implement installation-without-restart for extensions
without changes on their end.

To sum up, implementing install-without-restart would involve at least:
- fixing document.loadOverlay
- designing API for extensions to rely on for initialization, instead
of startup and load events they're currently using, documenting it
- writing the code to install extensions without restart
- fixing the issues that come up when people start porting their
extensions to the new mechanism

This was planned for Firefox 3, but was dropped due to lack of resources.

Upgrading/uninstalling is even harder, because you need a way to undo
all the changes an extension made to the UI. We currently don't even
have a way to "unload" overlays.

Also I'm afraid that the code extensions will have to include to
support (un)install-without-restart would be under-tested, because it
would often have to be different than the usual startup code and it
would only be run once.

Nickolay
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question on need to restart browser after installing new extension

Matthew Gertner
In reply to this post by Pravin-3
Nickolay Ponomarev wrote:
> The JS code in nearly all extensions does some initialization on
> application startup or when a window it overlays loads. It's
> impossible to implement installation-without-restart for extensions
> without changes on their end.

Why not simply reload all chrome that is affected by relevant overlays?
A second phase might be to include hints in overlays about what they
might affect (reducing the scope of what has to be reloaded) and/or
deducing this programatically. This strikes me as far better than having
to restart Firefox.
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question on need to restart browser after installing new extension

Nickolay Ponomarev
On 9/7/07, Matthew Gertner <[hidden email]> wrote:
> Nickolay Ponomarev wrote:
> > The JS code in nearly all extensions does some initialization on
> > application startup or when a window it overlays loads. It's
> > impossible to implement installation-without-restart for extensions
> > without changes on their end.
>
> Why not simply reload all chrome that is affected by relevant overlays?

Reloading chrome means losing any changes that were made to it by
scripts, as well as the script's state.

> A second phase might be to include hints in overlays about what they
> might affect (reducing the scope of what has to be reloaded) and/or
> deducing this programatically. This strikes me as far better than having
> to restart Firefox.

I don't see how it's different from document.loadOverlay.

Nickolay
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question on need to restart browser after installing new extension

Matthew Gertner
In reply to this post by Matthew Gertner
Nickolay Ponomarev wrote:

> On 9/7/07, Matthew Gertner <[hidden email]> wrote:
>> Nickolay Ponomarev wrote:
>>> The JS code in nearly all extensions does some initialization on
>>> application startup or when a window it overlays loads. It's
>>> impossible to implement installation-without-restart for extensions
>>> without changes on their end.
>> Why not simply reload all chrome that is affected by relevant overlays?
>
> Reloading chrome means losing any changes that were made to it by
> scripts, as well as the script's state.

Right, well you would rerun all the relevant scripts when you reload the
overlays. Basically I'm proposing an intermediate stage which would be
basically restarting Firefox but without the restarting Firefox part
(i.e. no need to quit and restart the actual OS process).

>
>> A second phase might be to include hints in overlays about what they
>> might affect (reducing the scope of what has to be reloaded) and/or
>> deducing this programatically. This strikes me as far better than having
>> to restart Firefox.
>
> I don't see how it's different from document.loadOverlay.

Can you explain in a bit more detail how your solution using
document.loadOverlay would work?

Matt
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: question on need to restart browser after installing new extension

Nickolay Ponomarev
On 9/7/07, Matthew Gertner <[hidden email]> wrote:
> > Reloading chrome means losing any changes that were made to it by
> > scripts, as well as the script's state.
>
> Right, well you would rerun all the relevant scripts when you reload the
> overlays. Basically I'm proposing an intermediate stage which would be
> basically restarting Firefox but without the restarting Firefox part
> (i.e. no need to quit and restart the actual OS process).
>
In particular, you lose your open tabs in the browser, which have to
be reopened after the chrome is reloaded. Whenever our session store
or necko cache implementation is imperfect, you lose data. It's better
to let the user restart the application explicitly, because he expects
to hit the session store quirks when he does.

> >> A second phase might be to include hints in overlays about what they
> >> might affect (reducing the scope of what has to be reloaded) and/or
> >> deducing this programatically. This strikes me as far better than having
> >> to restart Firefox.
> >
> > I don't see how it's different from document.loadOverlay.
>
> Can you explain in a bit more detail how your solution using
> document.loadOverlay would work?
>
I'm not sure we're talking about the same thing. My point is pretty
obvious - pretty much any overlay [if we forget about dynamic overlay
bugs] can be loaded both at the document load time and dynamically via
document.loadOverlay. The result would be similar, except:
1. the overlay scripts that may be relying on the "load" event won't
get it, and
2. if some script modified the overlay points (e.g. removed the Tools
menu you're overlaying or changed its id or anything like that), the
overlay won't get fully applied.

Nickolay

P.S. this is quite off-topic for dev-xpcom, but I'm not too worried
since this group is getting closed in a day anyways :)
_______________________________________________
dev-tech-xpcom mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xpcom
Loading...