If window.navigator.userAgent is deprecated, what should I use instead?

blub

The MDN documentation says that window.navigator.userAgent is deprecated and should not be used. If I want to collect the users browser and os data for analytics (not feature detection), what should I use instead?

Mate Hegedus

The user agent string is becoming meaningless and extremely unreliable.

You should not use user agent string, rather you should use feature detection. If you need to use feature X, test to see if X is available.

But to also answer your question directly, there is no JS alternative.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What should I use instead of deprecated CollectionModel?

getAdapterPosition Deprecated What should I use instead?

requestAccessToAccountsWithType is deprecated in ios6.1, what should i use instead?

HttpClient.getParams() deprecated. What should I use instead?

RestDocumentation class is deprecated, what should I use instead?

rxjs Subject.create deprecated - what should I use instead?

If `when (a) in x..y` is deprecated, what should I use instead?

GUIText is deprecated, so what should I use instead of it?

GUITexture is deprecated, so what should I use instead of it?

QT: QDesktopWidget is deprecated. What should I use instead?

UIBarButtonItemStyleBordered is deprecated; what should I do, instead?

'event' is deprecated , what can I use instead?

ANTLRFileStream is deprecated, what can I use instead?

LocalBroadcastManager has been deprecated. What I should use instead in its place?

java.net.URLEncoder.encode(String) is deprecated, what should I use instead?

Since g:remoteFunction in Grails 2.4.X is deprecated what should i use instead?

Elasticsearch.Net.ElasticSearch.Path is deprecated, what should I use instead?

What should I use instead of the deprecated KeyboardEvent.which and KeyboardEvent.keyCode?

"The media query -ms-viewport has been deprecated." What should I use instead?

In what sense, is `lvmdiskscan` deprecated,and we should use `pvs` instead?

Observer is deprecated in Java 9. What should we use instead of it?

Node url.format is deprecated, what should we use instead?

firrtl.Driver is deprecated - but what should we use instead?

Android : What should I do instead of using a deprecated function(getwidth() )?

What should I use instead of 'lifetime' in this FQL?

What should I use instead of isinstance()

What should I use instead of useSelector or mapStateToProps?

Scala 2.11 LinkedList is deprecated, what should I use?

The type JFreeChartRenderer is deprecated, what method should I use?