Socket
Socket
Sign inDemoInstall

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.2.0 to 0.3.0

56

bowser.js

@@ -17,2 +17,3 @@ /*!

* IE: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"
* IE>=11: "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; Media Center PC 6.0; rv:11.0) like Gecko"
* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"

@@ -23,2 +24,3 @@ * 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"

* Touchpad: "Mozilla/5.0 (hp-tabled;Linux;hpwOS/3.0.5; U; en-US)) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.83 Safari/534.6 TouchPad/1.0"
* PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34"
*/

@@ -28,5 +30,6 @@

, t = true
, ie = /msie/i.test(ua)
, ie = /(msie|trident)/i.test(ua)
, chrome = /chrome/i.test(ua)
, safari = /safari/i.test(ua) && !chrome
, phantom = /phantom/i.test(ua)
, safari = /safari/i.test(ua) && !chrome && !phantom
, iphone = /iphone/i.test(ua)

@@ -36,3 +39,3 @@ , ipad = /ipad/i.test(ua)

, android = /android/i.test(ua)
, opera = /opera/i.test(ua)
, opera = /opera/i.test(ua) || /opr/i.test(ua)
, firefox = /firefox/i.test(ua)

@@ -42,2 +45,3 @@ , gecko = /gecko\//i.test(ua)

, webkitVersion = /version\/(\d+(\.\d+)?)/i
, firefoxVersion = /firefox\/(\d+(\.\d+)?)/i
, o

@@ -49,4 +53,8 @@

msie: t
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}
, version: ua.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion) ? ua.match(webkitVersion)[1] : ua.match(/opr\/(\d+(\.\d+)?)/i)
}
if (chrome) return {

@@ -56,3 +64,8 @@ webkit: t

, version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}
}
if (phantom) return {
webkit: t
, phantom: t
, version: ua.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]
}
if (touchpad) return {

@@ -62,10 +75,10 @@ webkit: t

, version : ua.match(/touchpad\/(\d+(\.\d+)?)/i)[1]
}
}
if (iphone || ipad) {
o = {
webkit: t
, mobile: t
, ios: t
, iphone: iphone
, ipad: ipad
webkit: t
, mobile: t
, ios: t
, iphone: iphone
, ipad: ipad
}

@@ -82,4 +95,4 @@ // WTF: version is not part of user agent in web apps

, mobile: t
, version: ua.match(webkitVersion)[1]
}
, version: (ua.match(webkitVersion) || ua.match(firefoxVersion))[1]
}
if (safari) return {

@@ -89,12 +102,8 @@ webkit: t

, version: ua.match(webkitVersion)[1]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion)[1]
}
}
if (gecko) {
o = {
gecko: t
, mozilla: t
, version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
gecko: t
, mozilla: t
, version: ua.match(firefoxVersion)[1]
}

@@ -107,3 +116,4 @@ if (firefox) o.firefox = t

, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
}
}
return {}
}

@@ -110,0 +120,0 @@

@@ -6,2 +6,2 @@ /*!

*/
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function p(){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(h)return{webkit:b,touchpad:b,version:a.match(/touchpad\/(\d+(\.\d+)?)/i)[1]};if(f||g){o={webkit:b,mobile:b,ios:b,iphone:f,ipad:g},n.test(a)&&(o.version=a.match(n)[1]);return o}if(i)return{webkit:b,android:b,mobile:b,version:a.match(n)[1]};if(e)return{webkit:b,safari:b,version:a.match(n)[1]};if(j)return{opera:b,version:a.match(n)[1]};if(l){o={gecko:b,mozilla:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]},k&&(o.firefox=b);return o}if(m)return{seamonkey:b,version:a.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}}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=/ipad/i.test(a),h=/touchpad/i.test(a),i=/android/i.test(a),j=/opera/i.test(a),k=/firefox/i.test(a),l=/gecko\//i.test(a),m=/seamonkey\//i.test(a),n=/version\/(\d+(\.\d+)?)/i,o,q=p();q.msie&&q.version>=7||q.chrome&&q.version>=10||q.firefox&&q.version>=4||q.safari&&q.version>=5||q.opera&&q.version>=10?q.a=b:q.msie&&q.version<7||q.chrome&&q.version<10||q.firefox&&q.version<4||q.safari&&q.version<5||q.opera&&q.version<10?q.c=b:q.x=b;return q})
!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"&&module.exports?module.exports.browser=t():this[e]=t()}("bowser",function(){function g(){return n?{msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:l?{opera:t,version:e.match(d)?e.match(d)[1]:e.match(/opr\/(\d+(\.\d+)?)/i)}:r?{webkit:t,chrome:t,version:e.match(/chrome\/(\d+(\.\d+)?)/i)[1]}:i?{webkit:t,phantom:t,version:e.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]}:a?{webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:o||u?(m={webkit:t,mobile:t,ios:t,iphone:o,ipad:u},d.test(e)&&(m.version=e.match(d)[1]),m):f?{webkit:t,android:t,mobile:t,version:(e.match(d)||e.match(v))[1]}:s?{webkit:t,safari:t,version:e.match(d)[1]}:h?(m={gecko:t,mozilla:t,version:e.match(v)[1]},c&&(m.firefox=t),m):p?{seamonkey:t,version:e.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}:{}}var e=navigator.userAgent,t=!0,n=/(msie|trident)/i.test(e),r=/chrome/i.test(e),i=/phantom/i.test(e),s=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/android/i.test(e),l=/opera/i.test(e)||/opr/i.test(e),c=/firefox/i.test(e),h=/gecko\//i.test(e),p=/seamonkey\//i.test(e),d=/version\/(\d+(\.\d+)?)/i,v=/firefox\/(\d+(\.\d+)?)/i,m,y=g();return y.msie&&y.version>=7||y.chrome&&y.version>=10||y.firefox&&y.version>=4||y.safari&&y.version>=5||y.opera&&y.version>=10?y.a=t:y.msie&&y.version<7||y.chrome&&y.version<10||y.firefox&&y.version<4||y.safari&&y.version<5||y.opera&&y.version<10?y.c=t:y.x=t,y})

@@ -21,3 +21,2 @@ require('smoosh').config({

, "indent": 2
, "whitespace": true
, "asi": true

@@ -27,2 +26,2 @@ , "laxbreak": true

}
}).run().build().analyze()
}).run().build().analyze()

@@ -5,3 +5,3 @@ {

, "keywords": ["ender", "browser", "sniff", "detection"]
, "version": "0.2.0"
, "version": "0.3.0"
, "homepage": "https://github.com/ded/bowser"

@@ -8,0 +8,0 @@ , "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"

@@ -12,2 +12,3 @@ !function (name, definition) {

* IE: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"
* IE>=11: "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; Media Center PC 6.0; rv:11.0) like Gecko"
* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"

@@ -18,2 +19,3 @@ * 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"

* Touchpad: "Mozilla/5.0 (hp-tabled;Linux;hpwOS/3.0.5; U; en-US)) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.83 Safari/534.6 TouchPad/1.0"
* PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34"
*/

@@ -23,5 +25,6 @@

, t = true
, ie = /msie/i.test(ua)
, ie = /(msie|trident)/i.test(ua)
, chrome = /chrome/i.test(ua)
, safari = /safari/i.test(ua) && !chrome
, phantom = /phantom/i.test(ua)
, safari = /safari/i.test(ua) && !chrome && !phantom
, iphone = /iphone/i.test(ua)

@@ -31,3 +34,3 @@ , ipad = /ipad/i.test(ua)

, android = /android/i.test(ua)
, opera = /opera/i.test(ua)
, opera = /opera/i.test(ua) || /opr/i.test(ua)
, firefox = /firefox/i.test(ua)

@@ -37,2 +40,3 @@ , gecko = /gecko\//i.test(ua)

, webkitVersion = /version\/(\d+(\.\d+)?)/i
, firefoxVersion = /firefox\/(\d+(\.\d+)?)/i
, o

@@ -44,4 +48,8 @@

msie: t
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}
, version: ua.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion) ? ua.match(webkitVersion)[1] : ua.match(/opr\/(\d+(\.\d+)?)/i)
}
if (chrome) return {

@@ -51,3 +59,8 @@ webkit: t

, version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}
}
if (phantom) return {
webkit: t
, phantom: t
, version: ua.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]
}
if (touchpad) return {

@@ -57,10 +70,10 @@ webkit: t

, version : ua.match(/touchpad\/(\d+(\.\d+)?)/i)[1]
}
}
if (iphone || ipad) {
o = {
webkit: t
, mobile: t
, ios: t
, iphone: iphone
, ipad: ipad
webkit: t
, mobile: t
, ios: t
, iphone: iphone
, ipad: ipad
}

@@ -77,4 +90,4 @@ // WTF: version is not part of user agent in web apps

, mobile: t
, version: ua.match(webkitVersion)[1]
}
, version: (ua.match(webkitVersion) || ua.match(firefoxVersion))[1]
}
if (safari) return {

@@ -84,12 +97,8 @@ webkit: t

, version: ua.match(webkitVersion)[1]
}
if (opera) return {
opera: t
, version: ua.match(webkitVersion)[1]
}
}
if (gecko) {
o = {
gecko: t
, mozilla: t
, version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
gecko: t
, mozilla: t
, version: ua.match(firefoxVersion)[1]
}

@@ -102,3 +111,4 @@ if (firefox) o.firefox = t

, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
}
}
return {}
}

@@ -105,0 +115,0 @@

/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2011
*/
* MIT License | (c) Dustin Diaz 2013
*/
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