Nuxt/examples/middleware/middleware/user-agent.js
2017-10-28 14:09:21 +02:00

4 lines
133 B
JavaScript

export default function (context) {
context.userAgent = process.server ? context.req.headers['user-agent'] : navigator.userAgent
}