Is there a way to detect win service pack with javascript?
I know the OS name can be retrieved using the navigator object with javascript, but what about the service pack version?
Is there a way开发者_如何学C to do this with pure js? (without java or flash)
According to http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx
Alternate tokens can appear in the user-agent string for a number of reasons; usually, they identify optional features installed on your system. For example, an "SV1" token appears in the user-agent string of a user who has installed Windows XP Service Pack 2 (SP2). It is also important to note that certain non-Microsoft parties modify the user-agent string for their own purposes.
It's SV1 because SP2 is also Security Version 1. So you could do:
/sv1/i.test(navigator.userAgent)
...to detemine if SV1 is contained within the user agent string. I wasn't able to find if there's any token associated with SP1.
精彩评论