util/ BrowserSniffer.js

Basic browser sniffer

Copyright

2004 Rob Rohan (robr.nosp@m.ohan@gmai.nosp@m.l.com) All rights reserved

Summary
Basic browser sniffer
the library version
object to tell what kind of browser is hitting the site
boolean for is safari
boolean for is gecko
boolean for is internet explorer
boolean for is opera
boolean for is windows
boolean for is mac
boolean for is linux
boolean for is unix
gets the minor version (currently broken)
shows a displayable string for the browser (best guess)
does a printable (log or alert) string of what the sniffer thinks the current browser is

Variables

BROWSER_SNIFFER_VERSION

var BROWSER_SNIFFER_VERSION

the library version

SysBrowser

object to tell what kind of browser is hitting the site

Summary
boolean for is safari
boolean for is gecko
boolean for is internet explorer
boolean for is opera
boolean for is windows
boolean for is mac
boolean for is linux
boolean for is unix
gets the minor version (currently broken)
shows a displayable string for the browser (best guess)
does a printable (log or alert) string of what the sniffer thinks the current browser is

Variables

SysBrowser. safari

SysBrowser.safari

boolean for is safari

SysBrowser. gecko

SysBrowser.gecko

boolean for is gecko

SysBrowser. explore

SysBrowser.explore

boolean for is internet explorer

SysBrowser. opera

SysBrowser.opera

boolean for is opera

SysBrowser. windows

SysBrowser.windows

boolean for is windows

SysBrowser.mac

SysBrowser.mac

boolean for is mac

SysBrowser. linux

SysBrowser.linux

boolean for is linux

SysBrowser.unix

SysBrowser.unix

boolean for is unix

Functions

SysBrowser. getMajorVersion

guess the major version of the browser (seems IE6 says its IE4why do they suck so badly?)

Returns

an int version or -1 if unknown

SysBrowser. getMinorVersion

gets the minor version (currently broken)

Returns

the minor version

SysBrowser. getGuessDisplay

SysBrowser.getGuessDisplay = function __sysb__getGuessDisplay()

shows a displayable string for the browser (best guess)

Returns

a string display for the browser

SysBrowser. report

does a printable (log or alert) string of what the sniffer thinks the current browser is

Parameters

tboolean for show with br or new lines (default newline, true makes it br’s)

Return

a dump of what this object sees

var BROWSER_SNIFFER_VERSION
the library version
SysBrowser.safari
boolean for is safari
SysBrowser.gecko
boolean for is gecko
SysBrowser.explore
boolean for is internet explorer
SysBrowser.opera
boolean for is opera
SysBrowser.windows
boolean for is windows
SysBrowser.mac
boolean for is mac
SysBrowser.linux
boolean for is linux
SysBrowser.unix
boolean for is unix
SysBrowser.getGuessDisplay = function __sysb__getGuessDisplay()
shows a displayable string for the browser (best guess)