@webhandle/user-agent-detection
v1.0.0
Published
Detects browser and whether the browser is mobile
Readme
@webhandle/user-agent-detection
Detects browser and whether the browser is mobile
Install
npm install @webhandle/user-agent-detectionSetup with Webhandle
import setupUserAgentDetection from "@webhandle/user-agent-detection/initialize-webhandle-component.mjs"
await setupUserAgentDetection(webhandle)Usage
// the name of the browser
// 'firefox', 'opera', 'edge', 'ie', 'safari', 'chrome', 'bb10', 'android', 'ios', 'yandexbrowser', 'crios'
req.agentInfo.browser
// a boolean on whether the browser is mobile
req.agentInfo.mobile