Results 1 to 8 of 8

Thread: Firefox version sniffing

  1. #1
    Ext User
    Join Date
    May 2008
    Location
    Suffolk UK
    Posts
    15

    Default Firefox version sniffing

    Hay all,

    I had a search around the forum and couldn't find any information on this. I then turned to Google and found a way of telling what version of Firefox is being used.

    This is what I am using to detect the version:

    Code:
        if(navigator.userAgent.match("rv:1\.9")) {
            Ext.isFX3 = true;
            Ext.isFX2 = false;
            Ext.isFX15 = false;
            Ext.isFX3Plus = false;
        } else if(navigator.userAgent.match("rv:1\.8\.1")) {
            Ext.isFX3 = false;
            Ext.isFX2 = true;
            Ext.isFX15 = false;
            Ext.isFX3Plus = false;
        } else if(navigator.userAgent.match("rv:1\.8")) {
            Ext.isFX3 = false;
            Ext.isFX2 = false;
            Ext.isFX15 = true;
            Ext.isFX3Plus = false;
        } else {
            Ext.isFX3 = false;
            Ext.isFX2 = false;
            Ext.isFX15 = false;
            Ext.isFX3Plus = true;
        }
    Let me know what you think, If you can see any problems with it please let me know, have tested on firefox 2.0.0.1.6 and 3.0.1 and it seems to work well.

    Regards

    David

  2. #2
    Sencha Premium User NoahK17's Avatar
    Join Date
    Apr 2008
    Location
    Atlanta, GA
    Posts
    538

    Default

    Couldn't you just use one variable instead of using boolean values?
    Noah
    Front-End Developer
    Norfolk Southern

  3. #3

  4. #4
    Ext User
    Join Date
    May 2008
    Location
    Suffolk UK
    Posts
    15

    Default

    I guess, but I wanted it to work in that same way as the Ext sniffing.

    Unless I'm missing something you need to set them all for this to be available do you not?

    cheers,

  5. #5
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    they're public properties.
    just use them -- Ext sets them for you OOTB.

  6. #6
    Ext User
    Join Date
    May 2008
    Location
    Suffolk UK
    Posts
    15

    Default

    Ahh I guess these must have been added in the new version?

    although I have downloaded it I have not yet put it into my app! that would have saved me a few mins.. never mind!

    cheers,

  7. #7
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    isGecko has been there since Ext 1.0.

    isGecko3 was added in 2.2.

    i can't remember when isGecko2 was added.

  8. #8
    Ext User
    Join Date
    May 2008
    Location
    Suffolk UK
    Posts
    15

    Default

    Quote Originally Posted by mystix View Post
    isGecko has been there since Ext 1.0.

    isGecko3 was added in 2.2.

    i can't remember when isGecko2 was added.
    You are right isGecko has been there since version 1, but In my case I needed to know what version of FF was being used, and isGecko2 and isGecko3 didnt come in till the new version, else Id have used it

    Thank you though, knowing that there is a solution already in Ext ill update my version and use the ext stuff, and change where my app uses the stuff I put together.

    cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •