views:

28

answers:

3

I am making an addon for both firefox and fennec and I want to know if it is running on fennec or not.

A: 

You could use document.getElementById("browsers"). In firefox, it's null but in fennec it returns a HTMLDivElement object

tmim
It's null now, but that could easily change in the future. It's better to use a more stable API.
sdwilsh
+1  A: 

The global Application object (provided by FUEL) will give you various properties such as name or id that you can use to determine this.

sdwilsh
+1  A: 

What sdwilsh said or using nsIXULAppInfo.

If Fennec does support FUEL (I haven't checked), it's a matter of personal preference which one to use. FUEL is supposed to be a simpler-to-use wrapper around the nsI* components.

Nickolay