Packagecom.cyntaxic.cyntils
Classpublic class CynBrowser
InheritanceCynBrowser Inheritance Object

The CynBrowser class contains static functions for get information about the SWFs containing HTML page including browser detection and URL manipulation. CynBrowser holds all of the JavaScript code inline inside the class to prevent needing additional files besides the class itself.



Public Methods
 MethodDefined By
  
addBrowserName(browser:String):Array
[static] Adds a browser string to the browser list.
CynBrowser
  
appName():String
[static] Gets navigator.appName from JavaScript.
CynBrowser
  
browserName():String
[static] Gets the name of the browser by extraction from the navigator.userAgent string.
CynBrowser
  
fullVersion():String
[static] Gets the full browser version by extraction from the navigator.userAgent string.
CynBrowser
  
[static] Makes a shallow copy of the browser strings that are being used for browser detection.
CynBrowser
  
getQueryParam(param:String):String
[static] Gets the value of the query string parameter passed in.
CynBrowser
  
isBrowser(browser:String):Boolean
[static] Checks to see if the param string is the browser being used.
CynBrowser
  
isChrome():Boolean
[static] Checks whether browser is Google Chrome or not.
CynBrowser
  
isFirefox():Boolean
[static] Checks whether browser is Mozilla Firefox or not.
CynBrowser
  
isMSIE():Boolean
[static] Checks whether browser is Internet Explorer or not.
CynBrowser
  
isOpera():Boolean
[static] Checks whether browser is Opera or not.
CynBrowser
  
isSafari():Boolean
[static] Checks whether browser is Apple Safari or not.
CynBrowser
  
isSeaMonkey():Boolean
[static] Checks whether browser is Mozilla SeaMonkey or not.
CynBrowser
  
majorVersion():String
[static] Gets only the major browser version by extraction from the navigator.userAgent string.
CynBrowser
  
url(base:Boolean = false, protocol:Boolean = true):String
[static] Returns the JavaScript window.location.href.
CynBrowser
  
userAgent():String
[static] Gets navigator.userAgent from JavaScript.
CynBrowser
Public Constants
 ConstantDefined By
  CHROME : String = Chrome
[static] Defines the value of the navigator.userAgent string for the Google Chrome Browser.
CynBrowser
  FIREFOX : String = Firefox
[static] Defines the value of the navigator.userAgent string for the Mozilla Firefox Browser.
CynBrowser
  MSIE : String = MSIE
[static] Defines the value of the navigator.userAgent string for the Internet Explorer Browser.
CynBrowser
  OPERA : String = Opera
[static] Defines the value of the navigator.userAgent string for the Opera Browser.
CynBrowser
  SAFARI : String = Safari
[static] Defines the value of the navigator.userAgent string for the Apple Safari Browser.
CynBrowser
  SEAMONKEY : String = SeaMonkey
[static] Defines the value of the navigator.userAgent string for the SeaMonkey Browser.
CynBrowser
Method Detail
addBrowserName()method
public static function addBrowserName(browser:String):Array

Adds a browser string to the browser list. This function run is every time isBrowser is run so it can check an updated list of browser strings.

Parameters

browser:String — The browser string to be added to the browser name array.

Returns
Array — The new list of browsers names as an array.

See also

appName()method 
public static function appName():String

Gets navigator.appName from JavaScript.

Returns
String — The app name string.
browserName()method 
public static function browserName():String

Gets the name of the browser by extraction from the navigator.userAgent string.

Returns
String — The name of the browser.
fullVersion()method 
public static function fullVersion():String

Gets the full browser version by extraction from the navigator.userAgent string.

Returns
String — The full version of the browser.
getBrowserNames()method 
public static function getBrowserNames():Array

Makes a shallow copy of the browser strings that are being used for browser detection.

Returns
Array — A copy of the browser names in the array.
getQueryParam()method 
public static function getQueryParam(param:String):String

Gets the value of the query string parameter passed in.

Parameters

param:String — The string value of the query param.

Returns
String — The value of the param or a blank string.
isBrowser()method 
public static function isBrowser(browser:String):Boolean

Checks to see if the param string is the browser being used. The function adds the attempted browser name to the tested browser array using getBrowserNames.

Parameters

browser:String — The browser string to check against.

Returns
Boolean — True if the browser string matches part of navigator.userAgent string.

See also

isChrome()method 
public static function isChrome():Boolean

Checks whether browser is Google Chrome or not.

Returns
Boolean — True if Chrome, otherwise false.
isFirefox()method 
public static function isFirefox():Boolean

Checks whether browser is Mozilla Firefox or not.

Returns
Boolean — True if Firefox, otherwise false.
isMSIE()method 
public static function isMSIE():Boolean

Checks whether browser is Internet Explorer or not.

Returns
Boolean — True if Internet Explorer, otherwise false.
isOpera()method 
public static function isOpera():Boolean

Checks whether browser is Opera or not.

Returns
Boolean — True if Opera, otherwise false.
isSafari()method 
public static function isSafari():Boolean

Checks whether browser is Apple Safari or not.

Returns
Boolean — True if Safari, otherwise false.
isSeaMonkey()method 
public static function isSeaMonkey():Boolean

Checks whether browser is Mozilla SeaMonkey or not.

Returns
Boolean — True if SeaMonkey, otherwise false.
majorVersion()method 
public static function majorVersion():String

Gets only the major browser version by extraction from the navigator.userAgent string.

Returns
String — The major version of the browser.
url()method 
public static function url(base:Boolean = false, protocol:Boolean = true):String

Returns the JavaScript window.location.href.

Parameters

base:Boolean (default = false)
 
protocol:Boolean (default = true)

Returns
String — The url string affected by parameters.
userAgent()method 
public static function userAgent():String

Gets navigator.userAgent from JavaScript.

Returns
String — The user agent string.
Constant Detail
CHROMEConstant
public static const CHROME:String = Chrome

Defines the value of the navigator.userAgent string for the Google Chrome Browser.

See also

FIREFOXConstant 
public static const FIREFOX:String = Firefox

Defines the value of the navigator.userAgent string for the Mozilla Firefox Browser.

See also

MSIEConstant 
public static const MSIE:String = MSIE

Defines the value of the navigator.userAgent string for the Internet Explorer Browser.

See also

OPERAConstant 
public static const OPERA:String = Opera

Defines the value of the navigator.userAgent string for the Opera Browser.

See also

SAFARIConstant 
public static const SAFARI:String = Safari

Defines the value of the navigator.userAgent string for the Apple Safari Browser.

See also

SEAMONKEYConstant 
public static const SEAMONKEY:String = SeaMonkey

Defines the value of the navigator.userAgent string for the SeaMonkey Browser.

See also