Could your draw the screen, then save that as a screenshot, and analyse the image?
> Visited-link styles aren't applied to links rendered in SVG images, so history information can't be retrieved, and native themes aren't rendered in SVG images, which makes it harder to determine the user's platform.