0.1.7 • Published 9 years ago

check-browser v0.1.7

Weekly downloads
147
License
MIT
Repository
github
Last release
9 years ago

check-browser

Ultra-thin wrapper around bowser with simple declarative interface

Usage

check-browser takes a single argument, a map of browser names to minimum version numbers, and returns a boolean value indicating whether or not the current browser is equal to or greater than one of the allowed ones. The browser names it uses are the same as bowser's keys:

  • chrome
  • safari
  • msie
  • opera
  • seamonkey
  • blackberry
  • bada
  • tizen
  • sailfish
  • android
  • windowsphone
  • ios (iphone / ipad / ipod)
  • firefoxos
  • webos

(not all of these are browsers, I know, but they will all work)

You may also use the others property to toggle whitelist/blacklist behavior. If others is true, browsers not explicitly listed will be considered valid. others defaults to false.

check-browser is also forgiving about capitalization, chrome/Chrome/CHROME, are all acceptable.

Examples

checkBrowser({
  msie: 7,
  chrome: 10,
  firefox: 3
});
checkBrowser({chrome: 33}) // Returns false for Firefox
checkBrowser({chrome: 33, others: true}) // Returns true for Firefox
0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago