How to detect browser using MooTools 1.3 javascript?

  • Avinash
  • 0
  • Oct 21, 2010
  • Tips & Tricks

Before some days MooTools have released their next version which is 1.3. This MooTools version comes with a lots of new features and fixes which are in earlier version. One of them is the Browser Object. The Browser Object is very useful, with this you not only can get information about you browser type and version but you can also get the users’ OS and plugin installed in browser. So let me show how can we get Browser features using Browser Object!

Check for the Browser and its version

// Check for the safari browser if(Browser.safari) { } // Check for the IE by name if(Browser.name == 'ie') { } // Check for the browser with version if(Browser.name == 'ie' && Browser.version == 7) { }
// Check for the safari browser
if(Browser.safari) { }

// Check for the IE by name
if(Browser.name == 'ie') { }

// Check for the browser with version
if(Browser.name == 'ie' && Browser.version == 7) { }

Check for the Plugin

// Check for the flash and version if(Browser.Plugins.Flash && Browser.Plugins.Flash.version > 9) { }
// Check for the flash and version
if(Browser.Plugins.Flash && Browser.Plugins.Flash.version > 9) { }

Checking for OS

// Check for windows by name if(Browser.Platform.name == 'win') { } // Check for mac by property if(Browser.Platform.mac) { }
// Check for windows by name
if(Browser.Platform.name == 'win') { }

// Check for mac by property
if(Browser.Platform.mac) { }

Checking for Browser features

// Check for AJAX availability if(Browser.Features.xhr) { } // Check for Adobe AIR if(Browser.Features.air) { }
// Check for AJAX availability
if(Browser.Features.xhr) { }

// Check for Adobe AIR
if(Browser.Features.air) { }


The Browser Object is a great utility for the websites which are based on browser version or features. What you think about this share with the comments here.

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: