We are looking for a way to collect usage stats of our users web browser/OS configuration in regards to accessibility to better understand the range of users we have. If I can find a way to collect this data via javascript then I can capture it in via our analytics tool (same as google analytics variables).
These are some of the things we would like to know
开发者_JS百科- Users who have increased their text size (EG to "Largest in IE8). This would be different to the page zooming feature most modern browsers have.
- High Contrast settings at the OS level.
Are there any javascript tests/tricks to check for these?.. I'm happy to try browser specific solutions.
Thanks!
To check for font size variations - render two sets of text, one in 12px and one at .75em, the 12px will stay the same height regardless of the text-zoom, as where the .75em will shrink or grow depending on the user's setting - I'm sure the differences vary a bit between browsers, but that could be tabulated before hand.
For browser zoom level in IE - How to get zoom level in Internet Explorer 7? (javascript)
and see mootinator's comment on webkit browsers.
For high-contrast settings my best guess would be to use an ActiveX object / FF Plugin to read the RGB value of a pixel on the page that you know to be of a particular color - render several colored pixels absolutely at some specific coordinate and have the plugin measure the color values at the same series of pixels to determine if they were all converted to black / white or if they retained their original colors.
The last one is definitely not a user friendly solution.
精彩评论