improved html5 detection