ASPAlliance: Articles, reviews, and samples for.net Developers http://www.aspalliance.com. Review: BrowserHawk 9



Similar documents
Freegal Frequently Asked Questions

Google Analytics Guide

Using Application Insights to Monitor your Applications

4 Understanding. Web Applications IN THIS CHAPTER. 4.1 Understand Web page development. 4.2 Understand Microsoft ASP.NET Web application development

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

City of Jacksonville 1 of 6 Start Here >>

Web Conferencing Version 8.3 Troubleshooting Guide

SellerDeck 2013 Reviewer's Guide

Lottery Looper. User Manual

Introduction site management software

Going Mobile-does your website work on mobile devices?

Website Audit Reports

Website Maintenance Information For My Clients Bob Spies, Flying Seal Systems, LLC Updated: 08- Nov- 2015

Google Analytics for Robust Website Analytics. Deepika Verma, Depanwita Seal, Atul Pandey

N-CAP Users Guide. Everything You Need to Know About Using the Internet! How Banner Ads Work

Page 18. Using Software To Make More Money With Surveys. Visit us on the web at:

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Your First Web Page. It all starts with an idea. Create an Azure Web App

Going Beyond SAP ITS Mobile Apps to a Responsive Design Mobile Apps. JK (JayaKumar Pedapudi) Principal Consultant NTT DATA, Inc.

Why Your Business Needs a Website: Ten Reasons. Contact Us: Info@intensiveonlinemarketers.com

Leonardo Hotels Group Page 1

A Sales Strategy to Increase Function Bookings

MASTERTAG DEVELOPER GUIDE

Module 6.3 Client Catcher The Sequence (Already Buying Leads)

Deep analysis of a modern web site

How To Understand The History Of The Web (Web)

HelpSystems Web Server User Guide

Create a free CRM with Google Apps

Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)

Next Generation Tech-Talk. Cloud Based Business Collaboration with Cisco Spark

How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac?

JMC Next Generation Web-based Server Install and Setup

Notes on how to migrate wikis from SharePoint 2007 to SharePoint 2010

User Guide. Copyright 2003 Networks Associates Technology, Inc. All Rights Reserved.

Law Conferencing uses the Webinterpoint 8.2 web conferencing platform. This service is completely reservationless and available 24/7.

Yottaa Site Optimizer Guide

Contents. Introduction. What is the Cloud? How does it work? Types of Cloud Service. Cloud Service Providers. Summary

8 illegitimate reasons for discrepancies between AdWords and Google Analytics conversions

Permission-Based Marketing for Lawyers

Jenesis Software - Podcast Episode 3

MAKING YOUR SITE MOBILE-FRIENDLY INCLUDES STEPS FOR GOOGLE MOBILE SEARCH COMPLIANCE

Detecting Anonymous Proxy Usage

Conducting Virtual Meetings

T his feature is add-on service available to Enterprise accounts.

Apache Configuration

Android Programming Family Fun Day using AppInventor

I N R O A D S, I N C. T R A I N I N G A N D D E V E L O P M E N T

Virto SharePoint Kanban Board Web Part Release User and Installation Guide

How to fill every seat in the house. An event manager s guide to SMS Marketing

Google Analytics Audit. Prepared For: Xxxxx

Windows Family Safety Filter

WebLogic Server 6.1: How to configure SSL for PeopleSoft Application

Pivot Charting in SharePoint with Nevron Chart for SharePoint

Windows Mail POP Instructions - Bloomsburg University Students

Visualizing an OrientDB Graph Database with KeyLines

USER MANUAL SlimComputer

Local Search Results Success

TG Web. Technical FAQ

Live Agent for Support Agents

HTML Basics(w3schools.com, 2013)

A Java proxy for MS SQL Server Reporting Services

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Software Requirements Specification. Web Library Management System

The web server administrator needs to set certain properties to insure that logging is activated.

Inventory and Analytics for Browser-based Applications in the Enterprise

ICS Technology. PADS Viewer Manual. ICS Technology Inc PO Box 4063 Middletown, NJ

WHITEPAPER. Skinning Guide. Let s chat Velaro info@velaro.com by Velaro

was made, the message will sit in the BoxTrapper queue for 15 days (a selectable number, by you) for your potential review in case a mistake was

Download & Install Service Packs

ClickDimensions Quick Start Guide For Microsoft Dynamics CRM /1/2011 ClickDimensions

Advantage of Jquery: T his file is downloaded from

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

Game Center Programming Guide

PLATO Learning Environment System and Configuration Requirements for workstations. October 27th, 2008

Upgrade from Windows 7 or 8.1. January 29, 2016

PLATO Learning Environment 2.0 System and Configuration Requirements. Dec 1, 2009

Using Google Analytics

Free Report. My Top 10 Tips to Betting Like a Pro With Zero Risk

Radio Toolbox And Player Embedding

Quick Start Guide. Installation and Setup

Kentico CMS, 2011 Kentico Software. Contents. Mobile Development using Kentico CMS 6 2 Exploring the Mobile Environment 1

Sales people who are trying to switch your phone service or put you on VoIP. Sales people who work for companies who fix billing errors.

JW Player Quick Start Guide

Christopher Seder Affiliate Marketer

So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going.

Migrating helpdesk to a new server

Please select one of the topics below.

COMMON CUSTOMIZATIONS

Here are the steps to configure Outlook Express for use with Salmar's Zimbra server. Select "Tools" and then "Accounts from the pull down menu.

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Choosing the web s future. Peter-Paul Koch Drupal Jam, 12 mei 2016

Transcription:

ASPAlliance: Articles, reviews, and samples for.net Developers http://www.aspalliance.com by Steven Smith, Founder of ASPAlliance Review: BrowserHawk 9 Bottom Line Up Front If you need to detect browser capabilities, browser settings, Java, JavaScript, or Flash, then I would strongly recommend you download cyscape BrowserHawk and give it a test drive. I found the product to be very mature, well-documented, easy to use, and full-featured. What issues I did encounter were "user error" (i.e., my fault), but even still cyscape's support was very responsive and helpful. While researching the market for browser detection controls, I couldn't find any real competitors -- BrowserHawk is the solution unless you want to build your own or live with the very limited capabilities of the ASP.NET Request.Browser object. My Scenario and Experiences I've written a custom web advertisement server which currently serves a couple million ad impressions per day. It's important that this application only show certain kinds of ads to users who can support them (for instance, Flash ads to users who have installed Flash), and that our reporting only include non-spider user agents. These are fairly simple requirements, but I also needed these calculations to be accurate, reliable, and extremely fast in order to avoid degrading my site's performance. Sample Usage - Detect Spiders One of my primary requirements for this component was that it quickly and accurately detects spiders (or crawlers) so that I could filter these requests from my statistics. While I certainly could have written my own user agent parsing engine to try and capture every known spider, new ones are being written every day (usually stupid ones that don't even know about robots.txt, but that's another issue), and I didn't really want to be saddled with learning about every new spider agent that came along. I was pleased to find that I could implement spider detection in my application with just two lines of code: Listing 1: Detect Spiders and Crawlers - C# cyscape.browserhawk.browserobj browobj = cyscape.browserhawk.browserobj.getbrowser(); bool iscrawler = browobj.crawler; At this point, it's a simple matter to limit activity logging to only non-crawler user agents, or to terminate the response immediately if the resource in question is not something a crawler should be looking at (for example, the stupid ones that ignore your robots.txt file). But is it fast? In short, yes. I did not run it through any vigorous stress tests using thousands of different user agent strings, but I did observe it using ASP.NET's Trace feature as well as run it in production for several months serving upwards of 30 requests per second at times. I never ran into any performance issues as a result of BrowserHawk. (I can say the same for cyscape's CountryHawk, but that is a review for another day.)

For anybody wondering why I didn't just use the built-in ASP.NET Request.Browser.Crawler property, the answer is I did. However, since the list of browsers this uses is by default rather antiquated and no automatic update service comes with it, I felt it would be best for my users if I invested in a professional and more accurate solution, which BrowserHawk provided. And indeed, there are a lot of user agents caught by BrowserHawk that the default ASP.NET object did not flag as crawlers, so BrowserHawk is in fact more effective. Sample Usage - Detect Flash This is covered in the documentation as well. There are two properties in the ExtendedBrowserObj object that relate to Flash: Plugin_Flash and Plugin_FlashVerEx. Normally you'll simply make use of the former. Note that the ExtendedBrowserObj must be instantiated early in the page life cycle, before anything has been sent to the client browser (e.g. above your <head> and any Response.Write statements -- typically at the top of Page_Load in ASP.NET apps). Listing 2: Detect Flash - C# <% ExtendedOptions options = new ExtendedOptions(); options.addproperties("plugin_flash"); ExtendedBrowserObj extbrow = BrowserObj.GetExtendedBrowser(options); <html> Plugin_Flash: <% Response.Write(extBrow.Plugin_Flash); </html> Note that the ExtendedBrowserObj is only available in the Professional or Enterprise edition of BrowserHawk. That's It? For my production needs, the two properties above pretty much exceeded my expectations. I had some issues due to my server configuration that were unique to my setup, which caused me some headaches implementing licensing, but cyscape's support was first-class, and they even sent me an updated build within a day or so of my contacting them that corrected the problem for my special case. Now, since this is a review, I don't want to leave you thinking that BrowserHawk only has two useful features. On the contrary -- I actually have quite a TODO list of features I would like to implement with the help of BrowserHawk that will make my sites more user friendly. If you'd like to see what BrowserHawk can tell you about your web visitors, go to their Browser Analysis Page. From there, you'll see everything from your current monitor display settings to your browser plugins to your Internet connection speed. Additional Cool Features As you can see if you took a moment to Analyze Your Browser, BrowserHawk can tell you a great deal more than whether the user is a crawler or has Flash installed. Perhaps your site relies on cookies or JavaScript to function properly. Not all browsers support these features, and most allow paranoid users to turn them off. BrowserHawk lets you easily see whether these features are available, allowing you to gracefully degrade (or inform the user they need to turn these features on or upgrade to a modern browser). Perhaps your site includes sensitive information that requires SSL encryption; use BrowserHawk to detect whether the browser supports SSL and if so, what keysize it is using. Otherwise, your users would receive error messages in their browser if your application tries to engage an SSL session when the user's browser has SSL disabled. Consider the visual design of your site. When the Web was young, design guidelines suggested sites be

usable at widths no more than 640 pixels wide. Some years went by, more people bought higher resolution monitors, and these guidelines grew to 800 or even 1000 pixels. Widescreen laptops today ship with 1680 pixel wide screens, but not everybody who comes to your site will have the same size of screen. Detect the user's screen size, installed fonts, and text size, and render your site accordingly. Plugins are cool browser features that don't always "just work," because not all users have them installed. Flash and Java are the most common browser plugins, but there are many others, including multimedia plugins like QuickTime, RealPlayer, and Media Player. For many entertainment sites, it's important to know which of these plugins the user has installed so the appropriate media format(s) can be presented. Similarly, the user's connection speed can be important when determining whether to send a large media clip or a small one, which is where the Broadband and ConnectionSpeed properties come into play. Now, it's all well and good that you can gather this sort of information about individual users, but what if you really want to know a breakdown of all your users' capabilities? Sure, you can write your own script to capture this information and store it in a database or something, but BrowserHawk has already done this for you. Simply configure the component to log statistics (accomplished via a web service on one of your servers), and the rest is done. You're free to create reports against the data, like these (but note that BrowserHawk does not provide a front end for these reports - it just logs the data). According to cyscape's users, it looks like only 0.26% of users are on 640x480 displays, while 12% are still using 800x600. Just about everyone else has at least 1024x768 resolution, with some lucky devils sporting 3840x1024 resolutions. Going a little deeper into the discussion of web analytics, BrowserHawk's reporting capabilities offer a great deal more depth than most web analysis packages, due to the additional data points it captures from each user. For instance, you can learn how many of your users have broadband versus dial-up, or have cookies or JavaScript enabled. This information can be extremely valuable when you're considering how to architect new features for your site. You can even tie associate session or user ids with the data, so that if a user reports an issue, you can immediately check the database to analyze their browser and system capabilities, which is invaluable for troubleshooting browser-specific problems. One More Scenario Let's say you're working on a web site that requires a minimum connection of 30kb/second from your user, a large screen size (1024x768 minimum), and Flash 6 or higher so you can deliver a really cool multiplayer game (or interactive chat, desktop sharing app, or whatever). As part of the application, you test the user's browser and connection speed to determine if they meet your minimum requirements. Doing so with a single C# page would look something like this: Figure 1: Minimum Requirements Not Met

With the requirements met, of course, the site would return a positive message and a link to the game. Listing 3 shows the code required, all in one ASPX page for simplicity. Listing 3 - Determining Minimum System Requirements Using BrowserHawk <%@ Page language="c#" <%@ Import Namespace="cyScape.BrowserHawk" <% ExtendedOptions options = new ExtendedOptions(); options.addproperties("plugin_flash"); options.addproperties("connectionspeed"); options.addproperties("height"); options.addproperties("width"); // note these 4 lines can all be done in // ExtendedOptions constructor in you prefer ExtendedBrowserObj extbrow = BrowserObj.GetExtendedBrowser(options); BrowserObj browobj = BrowserObj.GetBrowser(); bool meetsrequirements = true; // Detect Flash Settings int flashversion = extbrow.plugin_flash; string flashresult = "True (" + flashversion.tostring() + ")"; if(flashversion < 6) flashresult = "False - Please Install Flash";

// Detect Screen Size int height = extbrow.height; string heightresult = "True (" + height.tostring() + ")"; if(height < 768) heightresult = "False - (" + height.tostring() + ")"; int width = extbrow.width; string widthresult = "True (" + width.tostring() + ")"; if(width < 768) widthresult = "False - (" + width.tostring() + ")"; // detect connection speed double speed = (double)extbrow.connectionspeed; string speedresult = "True (" + System.Math.Round((speed/1024),0) + " kb)"; if(speed < 30*1024) speedresult = "False (" + System.Math.Round((speed/1024),0) + " kb)"; string meetsrequirementsmessage = "Your system meets the minimum requirements!"; if(!meetsrequirements) meetsrequirementsmessage = "Sorry, your system does not meet the minimum requirements to play."; <html><title>detect Minimum Requirements</title></head> <body> <h1>detecting Minimum Requirements</h1> <b><%=meetsrequirementsmessage</b> <ul> <li>flash Installed (6 or higher?): <%=flashresult </li> <li>screen Height (768 or higher?): <%=heightresult </li> <li>screen Width (1024 or higher?): <%=widthresult </li> <li>connection Speed (30 kb or higher?): <%=speedresult </li> </ul> </body> </html> Summary BrowserHawk is a powerful server-side component that integrates into existing classic ASP and ASP.NET sites in just minutes. It is very easy to use, and with just a few lines of code you can detect just about any browser and system settings you need to ensure your web site functions as intended. BrowserHawk is a very mature product and has been around for nearly a decade now. My real-world testing of the product has shown that it works great. I highly recommend giving it a try and seeing just how much more powerful and elegant BrowserHawk is compared to any home-grown browser sniffer you may be using, and its advantages over ASP.NET's Browser.Request object. About the Author Steven Smith is president of AspAlliance.com and AspAdvice.com. He is a Microsoft Regional Director, an ASP.NET MVP, and an ASPInsider Board Member. He is an INETA Speaker Bureau member, and author of two books on ASP.NET.