navigator.userAgent not giving full user agent String
Currently getting this value: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
but i have tested online my Current user agent is: Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
i have tried with
<script>
document.write(window.navigator.userAgent);
</script>
and
<script>
document.write(navigator.userAgent);
</script>
It is giving me Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 not full String as i want.
It is not giving any information about mobile device or browser.
Do i need to add anything else to get full User Agent String ??
Refer to following documentation.
https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference
It is providing you a user agent string with all information. It is assuming you are using a WOW64 Windows device for some reason.
I think this link will answer your question:
Auto detect mobile browser (via user-agent?)
best regards
链接地址: http://www.djcxy.com/p/51906.html上一篇: 位或32