Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Browser UA match for safari

    I have a script that extracts the browser name from the User agent and tries to grab the version as well, but i'm not completely sure what i should be grabbing for safari browsers as i've only seen one example thus far in my logs:

    Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.6

    now looking at that it appears to be version 85.6 or 85.7 but both of those numbers seem very high, does anyone have any other examples of UAs from safari so i know what it is that i want to be matching/capturing

    if someone could provide some regexp that'll match a safari browser and grab the version number that'd be great

    TIA
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mine says the same thing, and it's 1.0 on OSX10.2. You certainly don't need to worry about earlier builds, because Safari updates come through automatically with System Update.

    But there is a 1.1 which is only available for OSX10.3; fraid I don't know the version number in the UA string.

    But btw - you know that detecting Safari with the UA string is not completely reliable - Safari has total spoofing where it can have a different UA string that doesn't mention Safari at all.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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