Recommend this page to a friend! |
Download .zip |
Info | Example | View files (5) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2015-12-18 (10 months ago) | Not enough user ratings | Total: 79 | All time: 416 This week: 17 |
Version | License | JavaScript version | Categories | |||
thrak-browser 1.0 | BSD License | 1.0 | Browser, jQuery, Utilities and Tools |
Description | Author | |
This object can retrieve information about the current browser. |
The $.browser jQuery object is yet another pitiful and lamentable attempt to unify the information provided by various navigators. It tries to detect navigator name, version and other information that could be useful.
It currently supports chrome, firefox, ie, opera, safari and webkit-compatible. I can add support for more exotic navigators if you provide me a link where I can download them.
I will support MS Edge when the following two conditions will become true :
Step 1 : Include jQuery :
<script language='javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'></script>
Step 2 : include the source file :
<script language="javascript" type="text/javascript" src="thrak.browser-1.0.0.js"></script>
And voilą ! the $.browser object is available to your script...
This section describes the information you can retrieve from the $.browser object.
A small distinction has been made here between members and properties : - members are properties that always return the same value - properties needs some code to be execute to compute their return value.
Returns the user agent string. For example :
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
A structure describing the browser application version and containing the following properties :
Casting this structure to a string will return the major and minor version. Example : "5.0"
The following boolean properties are set to true or false, depending on your browser type : chrome, safari, firefox, opera, ie, webkit or unknown.
Only one of them will be true at the same time and reflects the type of browser you are using. The unknown property will be set to true if your browser type cannot be detected.
Note that I don't know so far what to do with the webkit property.
The $.browser.name property will contain the name of the property in the above list which has been set to true.
True if cookies are enabled in the browser.
User-friendly browser display name.
True if "do no track" settings are enabled on your browser.
A structure containing the following properties that specifies the browser's language :
This structure can be casted to a string, to obtain something like, for example, "fr-FR".
Browser name, as supplied by the user agent string.
A boolean indicating whether browing is online or not.
A structure describing the browser's platform :
Note that these information are rarely specified by the browsers. This structure can be casted to a string, which will result in : "os/version".
A structure describing the product :
This structure can be casted to a string which will result in the product name.
A structure describing vendor information : - name : Vendor name. - build : Vendor's application build number. May be largely undefined in IE.
This structure can be casted to a string, which will result in : "name/build".
A structure containing the following properties, identifying the browser's version :
Note that the 'revision' and 'build' properties may not be specified by all browsers. This structure can be casted to a version string, for example :
alert ( "Version : " + $. browser. version ) ;
The returned string will include the major, minor, revision and build numbers separated by a dot. Missing components will not be included (if the revision is undefined, then the resulting string will only include the major and minor version numbers, even if the build number is defined).
This section describes all the runtime properties whose values must be retrieved using :
$.browser.prop( 'property name' ) ;
Note that the val() function is a synonym of prop().
Returns true if java is enabled in your browser, false otherwise.
To be documented.
Returns the width of a vertical scrollbar, in pixels.
Returns the height of a horizontal scrollbar, in pixels.
Files |
File | Role | Description |
---|---|---|
index.html | Example | Example script |
LICENSE | Lic. | License file |
NOTICE | Data | Disclaimer |
README.md | Doc. | Documentation |
thrak.browser-1.0.0.js | Class | Source file |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.