Advertisement

How not to do version detection

  • Dec. 18th, 2008 at 9:30 PM
dj blaster

Originally published at Hydrogen Economy. You can comment here or there.

Irrespective of your opinion of Flash, the following situation has arisen now that Flash 10 is out, and it bothers me greatly. A bunch of websites look at the Flash version string in order to figure out which version is installed. This string looks something like ‘Shockwave Flash 10.0 r12′ and is accessible from JavaScript as navigator.plugins["Shockwave Flash"] or similar. Some websites requiring a minimum version of Flash perform their version checking by finding the dot in the version string and then converting that character to an integer. Now that Flash 10 is out, browsers with Flash 10 installed are completely barred from some offenders. Others may at least allow a user to bypass the version detection. Of course the proper thing to do is to match against a regular expression like “\b(\d+)\.” and use a backreference, which you can very well do in JavaScript (RegExp.$1 in this case).

Latest Month

October 2009
S M T W T F S
    123
45678910
11121314151617
18192021222324
25262728293031

Syndicate

RSS Atom
Powered by LiveJournal.com
Designed by Gilbert Rizo