How not to do version detection
Posted by: mkb in Computers, tags: flash, javascript, rant, softwareIrrespective 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).
