Reidar Djupvik wrote:
> 
> For all the themes that the user don't have, a blank line is added in the 
> View > Apply Theme menu.

I don't know why. Possibly your contents.rdf are missing something that the
standard skins have, or maybe it's just a bug and the menu is hardcoded to
look for some specific package's skin.

> Secondly: My package is installed in the Chrome (Mozilla/chrome) folder, and 
> the extra skin files are installed and registered in the Chrome folder too. 
> This works well with Classic and Modern, but third-party themes are 
> installed in the Profile folder.

Shouldn't matter... the list of available skins is the combined list, should
be transparent outside the chrome system.

> How can I detect what themes are installed and only register them,

>From the install I think there's no way to do so. At least there's no way to
query the chrome system. You could maybe poke around on disk for common file
names but that's kinda ugly...

  var hasLopburi = File.exists(
       getFolder("Profile", "chrome/lopburi.zip")); // whatever the filename

I'm not recommending this approach.

> otherwise avoid the blank lines?

If you did manage to fix your contents.rdf to get the name in there (if that
is the problem) then folks could switch to these themes. But if your button
is the only thing in that theme the rest of their browser would be pretty
ugly after the switch.

> Should I change my app to install in the
> Profile folder? (I have tried to experiment with it using a constant 
> PROFILE_CHROME (the documentation doesn't mention it, seems to be outdated), 
> but it didn't work.) 

Profile 'content' isn't supported by the chrome system. Currently only skins
and locales can live in the profile.

> Do something else?

Could you ask the user on your page which themes they want installed? Then
you could pass that list into the script and use the arguments
functionality. You'd have to launch the install from a script so you could
read which checkboxes were checked... ending up with

var url = "http://host/path/my.xpi?lopburi;skypilot;Orbit";
InstallTrigger.install( {"Home Button" : url} );

Then in the script you could do


var args = new String(arguments);  // sorry arguments isn't already
                                   // a String, it's only a string


  if ( args.indexOf("lopburi") )
       register lopburi;

  if ( args. indexOf("eskimo") )
       register eskimo

That's the best I can think of for you at the moment.

-Dan Veditz


Reply via email to