%@ taglib uri='com.brainopolis.sniffer' prefix='sniffer' %>
<%@ page import="com.brainopolis.sniffer.BrowserBean" %>
<%
String browserBeanName = "snifferBean";
if (request.getParameter("clearSession") != null)
{
session.removeAttribute(browserBeanName);
out.println("Remove " + browserBeanName + " from session
");
}
%>
This project is intended to be an Open Source alternative to BrowserHawk. While it may (or may not) do all the aforementioned product does, that's where its aspirations live.
Sniffer jSniffy consists primarily of a BrowserBean. This bean holds information relating to the capabilities of the user's browser, as well as various user-configured options ("javascript is enabled" being the primary option).
The browser's base capabilities are loaded from an xml file, which also contains definitions of various OS/Platforms and ISP's. The BrowserStore is responsible for loading this information, and for parsing a user's request to determine additional capabilities.
In addition, the JavascriptTag works with the JavascriptServlet to transfer as much knowledge as possible about the client-side scripting capabilities to the server. A clean solution to accessing browser plugins is under investigation.
The AppletTag launches a small applet (the green box on this page) which determines more information about the Operating System, as well as the JVM information. It then transfers this information to a servlet running on the server. Note: there seems to be a problem with this communication, at least with IE 5.0.
To download, get zip file
Robot detection: Sniffer jSniffy needs to determine if the UserAgent is a robot, or other automated browser. I haven't determined an approach for this yet, as the list of possible robot agents is large and would take considerable time to iterate over. Since this would occur even if the UserAgent was one not listed in the definition file, I'm not ready to commit to this method.
WAP Detection: Due to inexperience, I don't know how to detect a WAP browser. Instruction would be appreciated.
Browser Height/Width: InternetExplorer doesn't support getting these attributes, unfortunately. Though I suspect there must be some agreeable method of doing so. If you know how to do this, please inform me.
New Browser Definitions: It has been suggested (thank you Henri) that a set of pages be written which will allow a person to submit a definition for their browser after performing some basic tests.
MSIE Specifics: I have no experience with ActiveScript/ActiveX/Whatever its called. If you would like to submit browser detection code for MSIE it would be appreciated.
Logging: A framework for logging Browser attributes would be nice. It should support file & JDBC logging. Need to determine where the logging definition (what to log, and where) should be. Then the LogView package being developed by bayard@generationjava.com could be applied to analyzing the logs.