开发者

Log user browser details in Node.js

开发者 https://www.devze.com 2023-04-02 23:30 出处:网络
Is there a way to log which browser/OS/etc. the user is using from my Node.js app?开发者_JAVA百科

Is there a way to log which browser/OS/etc. the user is using from my Node.js app?

开发者_JAVA百科

Thanks


I believe you want the information stored in the Request Header "User-Agent"

var useragent = request.headers['User-Agent']

My user-agent is: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" for chrome

0

精彩评论

暂无评论...
验证码 换一张
取 消