|
|
 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.
|
|
 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.zipcheers, doug.
MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
|
|
 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.
|
|
 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
|
|
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="<script src="/scripts/ff.js" type="text/javascript"></script>"> </?UMBRACO_MACRO>
<?UMBRACO_MACRO macroAlias="BrowserDetection" PropertyMatch="Browser=IE" ReturnText="<script src="/scripts/ie.js" type="text/javascript"></script>"> </?UMBRACO_MACRO>
Any suggestions?
Thanks, Bij
|
|
 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
|
|
Rank: Newbie
Joined: 6/1/2008 Posts: 2 Location: London, UK
|
Thanks very much for this Doug. Will give this a go :)
|
|
|
Guest |