Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bowser

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bowser - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

104

bowser.js

@@ -9,7 +9,10 @@ /*!

* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
* MIT License | (c) Dustin Diaz 2011
*/
!function (context) {
!function (name, definition) {
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
else this[name] = definition()
}('bowser', function () {
/**

@@ -22,49 +25,57 @@ * navigator.userAgent =>

* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"
* iPhone: "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5"
* Android: "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; T-Mobile G2 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
*/
var ua = navigator.userAgent,
ie = /msie/i.test(ua),
chrome = /chrome/i.test(ua),
safari = /safari/i.test(ua) && !chrome,
opera = /opera/i.test(ua),
firefox = /firefox/i.test(ua),
gecko = /gecko\//i.test(ua);
var ua = navigator.userAgent
, t = true
, ie = /msie/i.test(ua)
, chrome = /chrome/i.test(ua)
, safari = /safari/i.test(ua) && !chrome
, iphone = /iphone/i.test(ua)
, android = /android/i.test(ua)
, opera = /opera/i.test(ua)
, firefox = /firefox/i.test(ua)
, gecko = /gecko\//i.test(ua)
, webkitVersion = /version\/(\d+(\.\d+)?)/i
function detect() {
if (ie) {
return {
msie: 1,
version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
};
if (ie) return {
msie: t
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}
if (chrome) {
return {
webkit: 1,
chrome: 1,
version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
};
if (chrome) return {
webkit: t
, chrome: t
, version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}
if (safari) {
return {
webkit: 1,
safari: 1,
version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
};
if (iphone) return {
webkit: t
, iphone: t
, mobile: t
, version: ua.match(webkitVersion)[1]
}
if (opera) {
return {
opera: 1,
version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
};
if (android) return {
webkit: t
, android: t
, mobile: t
, version: ua.match(webkitVersion)[1]
}
if (safari) return {
webkit: t
, safari: t
, version: ua.match(webkitVersion)[1]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion)[1]
}
if (gecko) {
var o = {
gecko: 1,
version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
};
if (firefox) {
o.firefox = 1;
gecko: t
, version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
}
return o;
if (firefox) o.firefox = t
return o
}

@@ -74,3 +85,3 @@

var bowser = detect();
var bowser = detect()

@@ -84,3 +95,3 @@ // Graded Browser Support

(bowser.opera && bowser.version >= 9.5)) {
bowser.a = true;
bowser.a = t;
}

@@ -93,11 +104,6 @@

(bowser.opera && bowser.version < 9.5)) {
bowser.c = true;
} else {
bowser.x = true;
}
bowser.c = t
} else bowser.x = t
typeof module !== 'undefined' && module.exports ?
(module.exports.browser = bowser) :
(context.bowser = bowser);
}(this);
return bowser
})

@@ -8,6 +8,5 @@ /*!

* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
* MIT License | (c) Dustin Diaz 2011
*/
!function(a){function i(){if(c)return{msie:1,version:b.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:1,chrome:1,version:b.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(e)return{webkit:1,safari:1,version:b.match(/version\/(\d+(\.\d+)?)/i)[1]};if(f)return{opera:1,version:b.match(/version\/(\d+(\.\d+)?)/i)[1]};if(h){var a={gecko:1,version:b.match(/firefox\/(\d+(\.\d+)?)/i)[1]};g&&(a.firefox=1);return a}}var b=navigator.userAgent,c=/msie/i.test(b),d=/chrome/i.test(b),e=/safari/i.test(b)&&!d,f=/opera/i.test(b),g=/firefox/i.test(b),h=/gecko\//i.test(b),j=i();j.msie&&j.version>=6||j.chrome&&j.version>=8||j.firefox&&j.version>=3.6||j.safari&&j.version>=5||j.opera&&j.version>=9.5?j.a=!0:j.msie&&j.version<6||j.chrome&&j.version<8||j.firefox&&j.version<3.6||j.safari&&j.version<5||j.opera&&j.version<9.5?j.c=!0:j.x=!0,typeof module!="undefined"&&module.exports?module.exports.browser=j:a.bowser=j}(this)
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function l(){if(c)return{msie:b,version:a.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:b,chrome:b,version:a.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(f)return{webkit:b,iphone:b,mobile:b,version:a.match(k)[1]};if(g)return{webkit:b,android:b,mobile:b,version:a.match(k)[1]};if(e)return{webkit:b,safari:b,version:a.match(k)[1]};if(h)return{opera:b,version:a.match(k)[1]};if(j){var l={gecko:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]};return i&&(l.firefox=b),l}}var a=navigator.userAgent,b=!0,c=/msie/i.test(a),d=/chrome/i.test(a),e=/safari/i.test(a)&&!d,f=/iphone/i.test(a),g=/android/i.test(a),h=/opera/i.test(a),i=/firefox/i.test(a),j=/gecko\//i.test(a),k=/version\/(\d+(\.\d+)?)/i,m=l();return m.msie&&m.version>=6||m.chrome&&m.version>=8||m.firefox&&m.version>=3.6||m.safari&&m.version>=5||m.opera&&m.version>=9.5?m.a=b:m.msie&&m.version<6||m.chrome&&m.version<8||m.firefox&&m.version<3.6||m.safari&&m.version<5||m.opera&&m.version<9.5?m.c=b:m.x=b,m})
require('smoosh').config({
"JAVASCRIPT": {
"DIST_DIR": "./",
"bowser": [
"./src/copyright.js",
"./src/bowser.js"
"DIST_DIR": "./"
, "bowser": [
"./src/copyright.js"
, "./src/bowser.js"
]
},
"JSHINT_OPTS": {
"boss": true,
"forin": false,
"curly": true,
"debug": false,
"devel": false,
"evil": false,
"regexp": false,
"undef": false,
"sub": false,
"white": true,
"indent": 2,
"whitespace": true,
"asi": false
}
}).run().build().analyze();
, "JSHINT_OPTS": {
"boss": true
, "forin": false
, "curly": false
, "debug": false
, "devel": false
, "evil": false
, "regexp": false
, "undef": false
, "sub": true
, "white": false
, "indent": 2
, "whitespace": true
, "asi": true
, "laxbreak": true
}
}).run().build().analyze()
{
"name": "bowser",
"description": "a browser detector",
"keywords": ["ender", "browser", "sniff", "detection"],
"version": "0.0.5",
"homepage": "https://github.com/ded/bowser",
"author": "Dustin Diaz <@ded>",
"repository": {
"type": "git",
"url": "https://github.com/ded/bowser.git"
},
"main": "./bowser.js"
"name": "bowser"
, "description": "a browser detector"
, "keywords": ["ender", "browser", "sniff", "detection"]
, "version": "0.0.6"
, "homepage": "https://github.com/ded/bowser"
, "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
, "main": "./bowser.js"
, "repository": {
"type": "git"
, "url": "https://github.com/ded/bowser.git"
}
, "devDependencies": {
"smoosh": "*"
}
}
/*!
* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
* MIT License | (c) Dustin Diaz 2011
*/
!function (context) {
!function (name, definition) {
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
else this[name] = definition()
}('bowser', function () {
/**

@@ -15,49 +18,57 @@ * navigator.userAgent =>

* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"
* iPhone: "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5"
* Android: "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; T-Mobile G2 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
*/
var ua = navigator.userAgent,
ie = /msie/i.test(ua),
chrome = /chrome/i.test(ua),
safari = /safari/i.test(ua) && !chrome,
opera = /opera/i.test(ua),
firefox = /firefox/i.test(ua),
gecko = /gecko\//i.test(ua);
var ua = navigator.userAgent
, t = true
, ie = /msie/i.test(ua)
, chrome = /chrome/i.test(ua)
, safari = /safari/i.test(ua) && !chrome
, iphone = /iphone/i.test(ua)
, android = /android/i.test(ua)
, opera = /opera/i.test(ua)
, firefox = /firefox/i.test(ua)
, gecko = /gecko\//i.test(ua)
, webkitVersion = /version\/(\d+(\.\d+)?)/i
function detect() {
if (ie) {
return {
msie: 1,
version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
};
if (ie) return {
msie: t
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}
if (chrome) {
return {
webkit: 1,
chrome: 1,
version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
};
if (chrome) return {
webkit: t
, chrome: t
, version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}
if (safari) {
return {
webkit: 1,
safari: 1,
version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
};
if (iphone) return {
webkit: t
, iphone: t
, mobile: t
, version: ua.match(webkitVersion)[1]
}
if (opera) {
return {
opera: 1,
version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
};
if (android) return {
webkit: t
, android: t
, mobile: t
, version: ua.match(webkitVersion)[1]
}
if (safari) return {
webkit: t
, safari: t
, version: ua.match(webkitVersion)[1]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion)[1]
}
if (gecko) {
var o = {
gecko: 1,
version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
};
if (firefox) {
o.firefox = 1;
gecko: t
, version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
}
return o;
if (firefox) o.firefox = t
return o
}

@@ -67,3 +78,3 @@

var bowser = detect();
var bowser = detect()

@@ -77,3 +88,3 @@ // Graded Browser Support

(bowser.opera && bowser.version >= 9.5)) {
bowser.a = true;
bowser.a = t;
}

@@ -86,11 +97,6 @@

(bowser.opera && bowser.version < 9.5)) {
bowser.c = true;
} else {
bowser.x = true;
}
bowser.c = t
} else bowser.x = t
typeof module !== 'undefined' && module.exports ?
(module.exports.browser = bowser) :
(context.bowser = bowser);
}(this);
return bowser
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc