OS flag firefox extension / Componente

Are you looking for a way to detect which operating system (OS) is used from the inside an Firefox extension?
http://www.quirksmode.org/js/detect.html <- wrong way

Right way:

var OS = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime).OS;
alert(OS);
This entry was posted in jQuery & Javascript. Bookmark the permalink.

6 Responses to OS flag firefox extension / Componente

  1. Andy says:

    hi there, outstanding blog site, and a great understand! at least one for my bookmarking.

  2. Vita says:

    That is an issue I need to find more information about, appreciate the posting.

  3. Karol says:

    On the first sentence it seems to look like it were correct but if you prove it i cant see the point of this.

  4. Kalloch says:

    at the first sentence it seems to look like it was correct but if you look closely there is no sense of this!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>