1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Merge pull request #78 from lygstate/master

Add bowser test function.
This commit is contained in:
Dustin Diaz 2015-05-04 16:47:28 -07:00
commit f204fbeca5

View File

@ -232,6 +232,17 @@
var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '')
bowser.test = function (browserList) {
for (var i = 0; i < browserList.length; ++i) {
var browserItem = browserList[i];
if (typeof browserItem=== 'string') {
if (browserItem in bowser) {
return true;
}
}
}
return false;
}
/* /*
* Set our detect method to the main bowser object so we can * Set our detect method to the main bowser object so we can