First of all, Willamette is right that navigator.plugins.refresh(true) is
broken in general. Keep an eye on
http://bugzilla.mozilla.org/show_bug.cgi?id=61388
Charles Henri d'Argent wrote:
>
> this message is addressed to the developers of Netscape 6.
These newsgroups are for the developers of the Mozilla browser. Since
Netscape bases its browser on Mozilla you might get lucky, but in general
you should address Netscape issues to Netscape via its feedback pages which
are available from the Help menu within Netscape 6.
> I am experiencing the same behavior: I can not access the navigator object
> inside the install.js script that the Netscape 6 thread is executing. Even
> worst, I cannot access the window object. I must call
>navigator.plugins.refresh(true);
Install scripts run in their own context on their own thread. The global
object is the Install object, and there is no window object because there is
no window to which it could possibly refer. You will never be able to access
any window objects from an install because of threading issues with our
single-threaded UI. We may eventually figure out a way to let scripts spawn
a window on the UI thread and how to proxy information back to the calling
script.
For trivial things we do support alert() and confirm(), but not a generic
window.
> if I want the newly installed plugin to be visible just after performing
> SmartUpdate.
>
> 1.) How can I access the window object through Netscape 6's thread inside
> install.js ?
You can't.
> 2.) Is there some XPInstall api that replaces this plugins.refresh(true) call ?
> In which case, which function is it ? In which class ?
You can't now, but eventually there will be a way. Keep an eye on
http://bugzilla.mozilla.org/show_bug.cgi?id=62916
I'm being paid to fix that one, so I can be fairly confident in saying it'll
work in the next 6.x (*NOT* 6.0x) release of Netscape 6 barring major
personal disaster.
> 4.) Is there some work-around to refresh ? (Besides closing the browser and
> re-starting it).
The workaround was intended to be as Willamette says:
> > You can specify a callback function in the InstallTrigger.install() method.
> > Since the callback is called when the installation is completed, I figured I
> > would call navigator.plugins.refresh(true) there.
Unfortunately that's not currently working either as he goes on to say.
Supposedly navigator.plugins.refresh(false) works to reload the plugins
list, so you then only have to figure out how to reload the page manually.
Perhaps fiddling with the window location will do it, or worst case pop up
an alert() asking the user to reload the page.
-Dan Veditz