Archive → June, 2010
Detecting Safari 5.0 with browscap.ini
There are many ways to identify browsers on the server side. Gary Keith offers a quite complete mapping of user agent strings to browser/os versions enhanced with information about their capabilities. I guess it’s impressive how fast Gary was for all these years in adding new browsers to his browscap.ini and how reliable in keeping it up-to-date. Unfortunately, according to his website, he is currently facing health issues and cannot maintain the project for a while. So if you are using php_browscap.ini but missing Safari 5 or Chrome 6 support you can apply the patch listed below. Until then: Get well soon, Gary!
UPDATE:
Gary has uploaded a newer version of browscap.ini which now includes Safari 5 and Chrome 6. You don’t need to apply the patch below anymore.
--- browscap.ini_old 2010-06-22 21:50:30.000000000 +0200 +++ browscap.ini_new 2010-06-22 22:31:55.000000000 +0200 @@ -5504,6 +5504,57 @@ Win32=false Win64=true +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Chrome 6.0 + +[Chrome 6.0] +Parent=DefaultProperties +Browser="Chrome" +Version=6.0 +MajorVer=6 +Win32=true +Frames=true +IFrames=true +Tables=true +Cookies=true +JavaApplets=true +JavaScript=true +CssVersion=3 +supportsCSS=true + +[Mozilla/5.0 (Macintosh; U; Intel Mac OS X*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=MacOSX + +[Mozilla/5.0 (Windows; U; Windows NT 5.1; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=WinXP + +[Mozilla/5.0 (Windows; U; Windows NT 5.2; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=Win2003 + +[Mozilla/5.0 (Windows; U; Windows NT 6.0; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=WinVista + +[Mozilla/5.0 (Windows; U; Windows NT 6.1; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=Win7 + +[Mozilla/5.0 (Windows; U; Windows NT 7.0; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=Win7 + +[Mozilla/5.0 (X11; U; Linux i686*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Platform=Linux + +[Mozilla/5.0 (X11; U; Linux x86_64; *) AppleWebKit/* (KHTML, like Gecko) Chrome/6.* Safari/*] +Parent=Chrome 6.0 +Win32=false +Win64=true + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Google Code [Google Code] @@ -9604,6 +9655,47 @@ Parent=Safari 4.0 Platform=Win7 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Safari 5.0 + +[Safari 5.0] +Parent=DefaultProperties +Browser="Safari" +Version=5.0 +MajorVer=5 +Frames=true +IFrames=true +Tables=true +Cookies=true +BackgroundSounds=true +JavaApplets=true +JavaScript=true +CssVersion=3 +supportsCSS=true + +[Mozilla/5.0 (Macintosh; ?; *Mac OS X*; *) AppleWebKit/* (KHTML, like Gecko) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=MacOSX + +[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) AppleWebKit/* (*) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=WinXP + +[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) AppleWebKit/* (*) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=Win2003 + +[Mozilla/5.0 (Windows; ?; Windows NT 6.0; *) AppleWebKit/* (*) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=WinVista + +[Mozilla/5.0 (Windows; ?; Windows NT 6.1; *) AppleWebKit/* (*) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=Win7 + +[Mozilla/5.0 (Windows; ?; Windows NT 7.0; *) AppleWebKit/* (*) Version/5.0* Safari/*] +Parent=Safari 5.0 +Platform=Win7 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Lunascape 5.0 [Lunascape 5.0]