Detect if unity is installed via javascript in browser? (firefox, chrome)

In a browser (i'll be supporting firefox and chrome) I want to have a javascript function that returns true or false if unity is installed. Or perhaps a version number VS undefined/null/false or 0 if not installed.

How can i do this?

The first code snippet on this page

with the 2nd being the usage example