MooTools is cross-browser compliant, but CSS is not always as nice; let's figure out what browser is visiting us.
Create a string that has browser and platform particulars in it.
var browser_info = 'Your browser info: '+ Browser.name+' '+ Browser.version+' on '+ Browser.Platform.name;
MooTools works regular expression magic on the navigator.userAgent
. See this snippet from the source:
var ua = navigator.userAgent.toLowerCase(), platform = navigator.platform.toLowerCase(), UA = ua.match(/(opera|ie|firefox|chrome|version)[s/:]([wd.]+)?.*?( safari|version[s/:]([wd.]+)|$)/) || [null, 'unknown', 0], mode = UA[1] == 'ie' && document.documentMode; var Browser = this.Browser = { extend: Function.prototype.extend, name: (UA[1] == 'version') ? UA[3] : UA[1], version: mode || parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]), Platform: { name: ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match( /(?:webos...