Reputation: 3
How can I use userAgentData
on server(Nodejs)? In express i am trying to use new JS api:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData
I tried this `
console.log(global.navigator)
But this is printing undefined
.
I am also on https.
Upvotes: 0
Views: 203
Reputation: 591
You will be able to access that field as follows on client side:
window.navigator.userAgentData
Note:
You cannot access userAgentData
from the server. You would have to access the data in the frontend and pass it to your server through the request body.
Upvotes: 1