Simply put, "Am I Firefox or Thunderbird?"
Check the value of navigator.userAgent
This is what I use:
// -------------------
if (navigator.userAgent.search(/Thunderbird/gi) != -1) {
// Thunderbird specific code
} else {
// Firefox code
}
// ----------------
- Soyapi
--
Soyapi Mumba
soyapi.blogspot.com
searchwith.mozdev.org
Generally, if available, you should use nsIXULAppInfo for that.
See
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/irc/xul/content/static.js&rev=1.215#412
for an example.
HTH,
Gijs
http://developer.mozilla.org/en/docs/Using_nsIXULAppInfo#ID
"Note: you could also use nsIXULAppInfo.name, which is a human-readable
name for the application, such as "Firefox", but who knows, maybe
they'll rename it again!"
> http://developer.mozilla.org/en/docs/Using_nsIXULAppInfo
> http://developer.mozilla.org/en/docs/Using_nsIXULAppInfo#ID
> "Note: you could also use nsIXULAppInfo.name, which is a human-readable
> name for the application, such as "Firefox", but who knows, maybe
> they'll rename it again!"
Yeah. On Debian, Firefox is now known as IceWeasel for some obscure reason.
Phil
--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.