Browser Detection Options
VirtualRichard
Posted: Thursday, March 06, 2008 6:17:49 PM

Rank: Fanatic

Joined: 9/17/2007
Posts: 202
Location: London, UK.
Hello,

I scored a zero searching the community search on server-side browser detection and wondered whether anyone can provide me with some guidance on browser detection within Umbraco?

I'm interested in utilising either plain approaches using Browsercaps or (particularly) integrating the full-on Cyscape product, Browserhawk.

Thanks in advance,

Richard

P.s. Don't worry about Conditional Comments, I know about those and for client-side I can use jQuery.

2 * 3 * 3 * 37 : The prime factorisation of The Beast.
drobar
Posted: Thursday, March 06, 2008 6:29:46 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,410
Location: KY, USA
Hi, Richard,

Here's a tool I wrote some time ago to do exactly what you described. The zip file has documentation in it regarding how to install and use it. It was compiled for .NET 1.1 but I expect it'll run just fine under 2.0. Let me know if you have any problems.

http://umbraco.percipientstudios.com/downloads/umbraco/browserdetection1.0.zip

cheers,
doug.



MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
VirtualRichard
Posted: Friday, March 07, 2008 11:43:52 AM

Rank: Fanatic

Joined: 9/17/2007
Posts: 202
Location: London, UK.
That's superb, thank you!

Do you have the source or not mind if I just disassemble? I'm keen to get a deeper understanding of how it works.

Richard

2 * 3 * 3 * 37 : The prime factorisation of The Beast.
drobar
Posted: Friday, March 07, 2008 2:15:10 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,410
Location: KY, USA
Let me see if I can dig up the source.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
bijt
Posted: Wednesday, August 20, 2008 11:37:09 PM
Rank: Newbie

Joined: 6/1/2008
Posts: 2
Location: London, UK
Hi Doug,

This browser is just the thing i've been looking for. I've implemented this onto one of my templates and works fine for IE (using Browser=IE) but I can't seen to get it to detect firefox. This is what i'm using:

<?UMBRACO_MACRO
macroAlias="BrowserDetection"
PropertyMatch="Browser=Firefox"
ReturnText="&lt;script src=&quot;/scripts/ff.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;">
</?UMBRACO_MACRO>

<?UMBRACO_MACRO
macroAlias="BrowserDetection"
PropertyMatch="Browser=IE"
ReturnText="&lt;script src=&quot;/scripts/ie.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;">
</?UMBRACO_MACRO>

Any suggestions?

Thanks,
Bij
drobar
Posted: Thursday, August 21, 2008 1:12:26 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,410
Location: KY, USA
Hi, Bij,

Use this for your macro and you'll see all the fields you have available. Compare what is returned when you use IE vs. FF and you should be able to come up with the proper match.

<?UMBRACO_MACRO
macroAlias="BrowserDetection"
PropertyMatch=""
ReturnText=""
/>

Here are some common values for common browsers...
Code:
                         Firefox2.0       IE7        IE6
                         -------------    ------     ------
Id                       mozillafirefox   ie6to9     ie6to9
Type                     Firefox          IE7        IE6
Browser                  Gecko            IE         IE
Version                  1.8              7.0        6.0
Majorversion             1                7          6
MinorVersion             0.8              0          0
Platform                 WinXP            WinXP      WinNT
EcmaScriptVersion        1.5              1.2        1.2
Cookies                  True             True       True
VBScript                 False            True       True
JavaScript               True             True       True


cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
bijt
Posted: Thursday, August 21, 2008 12:50:20 PM
Rank: Newbie

Joined: 6/1/2008
Posts: 2
Location: London, UK
Thanks very much for this Doug. Will give this a go :)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.