Browser Detection Script - How to return type of Webkit?
timothyjoelwright
Status: New User - Welcome
Joined: 20 Aug 2009
Posts: 2
Reply Quote
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!!
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3895
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
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.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3895
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
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.
Back to top
timothyjoelwright
Status: New User - Welcome
Joined: 20 Aug 2009
Posts: 2
Reply Quote
Wow - that was really fast! Thank you!
It works great now.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours