I have been having random problems with my browser for some time now. Its been more annoying that anything else – Sirius radio wouldn’t stream, Yahoo Mail and Windows Live Mail wouldn’t render properly, etc.. No major crashes, just stuff didn’t work right.

My friends have been insisting it’s because I use the nightly WebKit drops (gotta have those latest bits.. :) ), but the normal install of Safari that comes with Leopard was also having issues.. Could it have been possible that I completely screwed up my OS?

Last night I randomly went to useragent.org (insipired by a completely unrelated conversation we were having at work about browser differences), and noticed that it was saying my User-Agent string was “Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)“.

Huh!

Some time ago, for reasons I can no longer remember, I must have modified my default User-Agent string for Safari to make it more “Windows compatible” with various sites. But that was my downfall, there must be some IE7 specific ‘fixes’ on sites that just throws WebKit/Safari for a loop.

Anyways, I was able fix it by opening up terminal and setting it back to the proper User-Agent string:

defaults write com.apple.Safari CustomUserAgent “\”Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.10.6 (KHTML, like Gecko) Version/3.0.4 Safari/523.10.6\”"

After that, BAM!

Yahoo Mail and Hotmail work perfectly and I can listen to music again via Sirius online streaming. A stupid string has caused me so much trouble.

I hate you User-Agent.

Bottom line: Browsers suck. Don’t mess with them.


4 Comments

    Brett Slaski (January 18, 2008 @ 3:46 pm)

    Yes, yes browsers do suck! Especially when they are filled with tens-of-thousands of lines of javascript.


    Brett Slaski (January 18, 2008 @ 3:48 pm)

    …for a login page!


    Mark Rowe (January 19, 2008 @ 11:32 am)

    It would probably be safer to do “defaults delete com.apple.Safari CustomUserAgent” to prevent your user agent string falling out of sync when WebKit and Safari are updated in the future.


    smakofs (January 19, 2008 @ 1:34 pm)

    Good point Mark – Thanks.


Sorry, the comment form is closed at this time.