Re: sidebar installation problem

Daniel Veditz <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
David Mischel wrote:
> I have a xul based application I want to install in the sidebar. It
> consists of an app.xul file and an app.js file.
> 
> I have tried two approaches but the preferred one does not work.
> 
> I would prefer to install it as a URL. When I try that two things don't
> work: the popup menu does not display properly (minor) and the
> javascript is not found at all (major). The same problems occur if I use
> the URL in the main browser window. Is this a security issue and if so
> is there a solution for the URL approach?

remote XUL is not privileged. I don't know exactly what you're trying, but
that would be my guess as the problem. I don't know whether code signing
works in XUL, but you probably don't want to go that approach anyway, you
want to install.

> The second approach was to install it via XPI. This was successful. I
> can call the app as a chrome URL in the browser and it works. But I can
> not install the chrome URL in the sidebar (illegal).

A bit of a catch-22, eh?  There's a bug on enhancing XPInstall to install
sidebars, but it got bogged down in grandiose plans by the sidebar folks to
rearchitect things. Those never happened of course :-(

The one approach I've seen is to install along with your chrome sidebar a
XUL page whose sole purpose is to get around the sidebar restrictions. Then
you have to provide a link for the user to open that page as chrome :-(

If you want to do this (it's a royal PITA) you can start with how the DOM
Inspector adds its sidebar from the pref panel option

http://lxr.mozilla.org/mozilla/source/extensions/inspector/resources/content/prefs/pref-sidebar.js#110

It's not all in that file, that makes heavy use of a bunch of js utility
functions (particularly ones for RDF) that you can also find elsewhere in
the inspector directories.

-Dan Veditz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.