Miss any of our Open RFC calls?Watch the recordings here! »

is-opera

2.0.1 • Public • Published

is-opera

Check if browser is Opera

User agent sniffing is considered bad practice and should be avoided if possible.

Install

$ npm install --save is-opera

Usage

var isOpera = require('is-opera');
 
isOpera();
//=> true
 
isOpera({version: 29});
//=> true
 
isOpera({userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 OPR/29.0.1795.60'});
//=> true

isOpera([options])

Returns a boolean.

options

Type: object

options.userAgent

Type: string

User agent to test.

options.version

Type: string or number

Check for specific version.

Related

  • brwsr - Get current browser

License

MIT © Andreas Gillström

Install

npm i is-opera

DownloadsWeekly Downloads

2

Version

2.0.1

License

MIT

Last publish

Collaborators

  • avatar