Search code examples
safariuser-agent

Safari 8 user agent string // Enabling & Opening Safari console


Hey there SO crew

Almost 2 years ago (1y and about 10mo) I posted this Safari 7 user-agent here and ever since it's just been standing there doing it's thing so I thought, why don't I take 5min and put this one on there as well since it might be interesting for some to use for purposes other than browser sniffing (even tho I think browser sniffing isn't at all bad if used the right way - the "eval = evil problem").

So my question obviously is: What is the Safari 8 User agent string?

As a side-question: If I am using Safari, how would I find my UA string?


Solution

  • Q1A: Aaand here it is, our Safari 8+ UA string.


    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12

    "How did I get it?" One might ask.

    Well this is not exactly difficult when sitting behind a mac with the latest Safari always installed but I do remember how annoyed I was that I couldn't find the Safari 7 UA string ANYWHERE.

    Anyways, if you're a developer and you're working on a Mac (perhaps a Junior? - like me :D) Here are some simple steps to find the UA of Safari:

    Q2A: Step 1: Open a webpage

    Open Safari first, then open any webpage (e.g. google.com)


    Q2A: Step 2: Open the console

    short way

    Press cmd + shift + i to open the console.

    long way

    In the top left menu bar hit Develop -> Show Web Inspector

    Don't see the Develop menu? Go to Safari -> Preferences (cmd + ,) -> Advanced -> Check the checkbox where it says Show Develop menu in menu bar


    Q2A: Step 3: Navigate to User-Agent

    With the Web Inspector open go to the Timelines menu

    enter image description here

    Then go to a random request that was made to the server from the page, I literally chose a random script anywhere under the resources pane below the timelines pane.

    Then look on the right side of the console (if the console displayed below the page and not next to it.) and check the Request Headers -> User-Agent

    If the console is displayed next to your browser window, you'll have to look for the icon to the right of the bin icon:

    enter image description here

    Clicking the icon will toggle the request information on or off accordingly.

    enter image description here

    And there it is, the UA in all of it's glory!

    Hope it helps - Sidney Liebrand