Copied from http://www.soundstep.com/blog/experiments/jsdetection/