timothyjoelwright
Status: New User - Welcome
Joined: 20 Aug 2009
Posts: 2
Back to top
Posted: Aug 20, 09, 12:48    Browser Detection Script - How to return type of Webkit?
Question: How can I return the type of Webkit being used? ie. Chrome, Safari, etc.

Intent: I'm using server-side browser detection to generate browser-specific CSS so the CSS is clean and I don't need to use hacks. Some quirks pop-up between Safari and Chrome that I need to address with variations in the CSS.

I apologize in advance if this is an obvious question. I'm a PHP novice, but I've searched these forums and other places and experimented with the PHP Browser Detection Script 4.10.2, however I'm unable to return anything beyond "webkit" and the version number.

I'm testing using Safari 4.0.3 and the latest 3.0 beta of Chrome - both on Mac and Windows.

Thank you!!
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 2541
Location: East Coast, West Coast? I know it's one of them.
Back to top
Posted: Aug 20, 09, 14:37    
that's full return array item index 7, for applewebkit version like safari.

I was going to upload an updated version with a new return option of webkit data, but I hit a php bug that is impossible so far to fix, the array value is lost for no reason I can see.
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 2541
Location: East Coast, West Coast? I know it's one of them.
Back to top
Posted: Aug 20, 09, 15:30    
Found the bug, see latest version 4.11.0 for full webkit options.

Changed logic slightly to help optimize page loads, now the 'full' option returns by default also $webkit_array and $moz_array as keys 10 and 11, but remember, those are arrays, so you have to extract them to work with them, or rather, extract their values.

See the your computer info script, which was also updated, to see how it works.
timothyjoelwright
Status: New User - Welcome
Joined: 20 Aug 2009
Posts: 2
Back to top
Posted: Aug 21, 09, 10:05    
Wow - that was really fast! Thank you!
It works great now.
Display posts from previous:   

All times are GMT - 8 Hours