Skip to content

fscherwi/get-user-agent

Repository files navigation

get-user-agent

Build Status Coverage Status

Easily generate a browser user agent!

Install

npm install get-user-agent

Example Usage

const useragent = require('get-user-agent');

console.log(useragent.firefox(75));

Functions

chrome(version, [sysInfo])string

Chrome user agent

chromeAdvanced(version, webkitVersion, [sysInfo])string

Chrome user agent with advanced options

firefox(version, [sysInfo])string

Safari user agent

firefoxAdvanced(version, geckoVersion, [sysInfo])string

Firefox user agent with advanced options

opera(version, [sysInfo])string

Opera user agent

operaAdvanced(version, prestoVersion, operaVersion, [sysInfo])string

Opera user agent with advanced options

safari(version, [sysInfo])string

Safari user agent

safariAdvanced(version, webkitBuildVersion, safariBuildVersion, [sysInfo])string

Safari user agent with advanced options

chrome(version, [sysInfo]) ⇒ string

Chrome user agent

Returns: string - User agent

Param Type Description
version number | string Browser version
sysInfo (optional) string System information

chromeAdvanced(version, webkitVersion, [sysInfo]) ⇒ string

Chrome user agent with advanced options

Returns: string - User agent

Param Type Description
version number | string Browser version
webkitVersion number | string Webkit version
sysInfo (optional) string System information

firefox(version, [sysInfo]) ⇒ string

Safari user agent

Returns: string - User agent

Param Type Description
version number | string Browser version
sysInfo (optional) string System information

firefoxAdvanced(version, geckoVersion, [sysInfo]) ⇒ string

Firefox user agent with advanced options

Returns: string - User agent

Param Type Description
version number | string Browser version
geckoVersion number | string Gecko version
sysInfo (optional) string System information

opera(version, [sysInfo]) ⇒ string

Opera user agent

Returns: string - User agent

Param Type Description
version number | string Browser version
sysInfo (optional) string System information

operaAdvanced(version, prestoVersion, operaVersion, [sysInfo]) ⇒ string

Opera user agent with advanced options

Returns: string - User agent

Param Type Description
version number | string Browser version
prestoVersion number | string Presto version
operaVersion number | string Opera version
sysInfo (optional) string System information

safari(version, [sysInfo]) ⇒ string

Safari user agent

Returns: string - User agent

Param Type Description
version number | string Browser version
sysInfo (optional) string System information

safariAdvanced(version, webkitBuildVersion, safariBuildVersion, [sysInfo]) ⇒ string

Safari user agent with advanced options

Returns: string - User agent

Param Type Description
version number | string Browser version
webkitBuildVersion number | string Webkit build version
safariBuildVersion number | string Safari build version
sysInfo (optional) string System information