Node.js examples for Environment:Browser
Piece of browser detection code from prototype.js
// piece of browser detection code from prototype.js chem.isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; chem.isIE = !!window.attachEvent && !chem.isOpera; chem.isWebKit = navigator.userAgent.indexOf('AppleWebKit/') > -1; chem.isGecko = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') === -1; chem.isMobileSafari = /Apple.*Mobile.*Safari/.test(navigator.userAgent);