PgwJS
Powered by Pagawa.com

PgwBrowser - Browser & OS / platform detection plugin for jQuery / Zepto

Download

Current version: 1.3
To download or fork this project, please visit our GitHub repository
And of course, you will need Jquery or Zepto to use this platforms / os and browsers detection plugin.
jquery zepto.js

Example

To test our plugin, please select a user-agent below:
(with a preset user-agent, only the viewport details will be depending on your browser)
PgwBrowser has found:
Loading...

Documentation

To detect the visitor's browser and platform, just call the following function:
var pgwBrowser = $.pgwBrowser();

Browser detection compatibility

The following browsers are detected by our plugin:

OS / Platform compatibility

The following operating systems are detected by the plugin:

Plugin return

PgwBrowser returns an object with four objects within:
"userAgent" - Returns the visitor's user-agent. For example:
userAgent : "Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"
"browser" - Returns the visitor's browser details. For example:
browser : {
      name : "Firefox",
      group : "Firefox",
      fullVersion : "31.0",
      majorVersion : 31,
      minorVersion : 0
}
- Name: The browser name (see all possibilities below).
- Group: The group name of the browser (see all possibilities below).
- Full version: The full version number, for example: "31.0" or "36.0.1985.125".
- Major version: The major version number, for example with the version "31.0": the number "31".
- Minor version: The minor version number, for example with the version "31.0": the number "0".
Group name Browser names
"Chrome" "Chrome", "Chrome Mobile", "Chrome for iOS", "Chromium", "Android Browser"
"Firefox" "Firefox"
"Explorer" "Internet Explorer", "IEMobile"
"Opera" "Opera", "Opera Mini"
"Safari" "Safari"
"Spartan" "Spartan"
"viewport" - Returns the visitor's window details. For example:
viewport": {
      width : 1903,
      height : 969,
      orientation : "landscape"
}
- Width: The width of the window in pixels.
- Height: The height of the window in pixels.
- Orientation: The orientation type of the window: "portrait" or "landscape".
"os" - Returns the visitor's platform details. For example:
os : {
      name : "Windows 8.1",
      group : "Windows",
      fullVersion : "8.1",
      majorVersion : 8,
      minorVersion : 1
}
- Name: The name of the operating system (see all possibilities below).
- Group: The group name of the OS (see all possibilities below).
- Full version: The full version number, for example: "8.1" or "10.9.3".
- Major version: The major version number, for example with the version "8.1": the number "8".
- Minor version: The minor version number, for example with the version "8.1": the number "1".
Group name Platform names
"Windows" "Windows 2000", "Windows XP", "Windows Vista", "Windows 7", "Windows 8", "Windows 8.1", "Windows" (the last one is only used when no other element has been matched)
"Windows Phone" "Windows Phone"
"Chrome OS" "Chrome OS"
"Android" "Android"
"iOS" "iPhone", "iPad", "iPod"
"Mac OS" "Mac OS X Cheetah", "Mac OS X Puma", "Mac OS X Jaguar", "Mac OS X Panther", "Mac OS X Tiger", "Mac OS X Leopard", "Mac OS X Snow Leopard", "Mac OS X Lion", "Mac OS X Mountain Lion", "Mac OS X Mavericks", "Mac OS X Yosemite", "Mac OS" (the last one is only used when no other element has been matched)
"Linux" "Ubuntu", "Debian", "Gentoo", "Linux" (the last one is only used when no other element has been matched)
"BlackBerry" "BlackBerry"

Plugin events

PgwBrowser::StartResizing - This event is launched when the resizing starts.
$(window).bind('PgwBrowser::StartResizing', function() {
    // Your code when the resizing starts.
});
PgwBrowser::StopResizing - This event is launched when the resizing stops.
$(window).bind('PgwBrowser::StopResizing', function() {
    // Your code when the resizing stops.
});
PgwBrowser::OrientationChange - This event is launched when the orientation changes.
$(window).bind('PgwBrowser::OrientationChange', function() {
    // Your code when the orientation changes.
});
jquery / zepto responsive slider - jquery / zepto responsive menu - jquery / zepto responsive modal / dialog - jquery / zepto cookie plugin