Bạn có thể chạy mã sau để phát hiện tính năng web worker trong trình duyệt:
<!DOCTYPE HTML>
<html>
<head>
<title>Big for loop</title>
<script src="/js/modernizr-1.5.min.js"></script>
<script>
function myFunction(){
if (Modernizr.webworkers) {
alert("Chúc mừng!! Bạn có hỗ trợ web workers.");
} else {
alert("Rất tiếc!! Bạn KHÔNG có hỗ trợ web workers.");
}
}
</script>
</head>
<body>
<button onclick="myFunction()">Click me</button>
</body>
</html>
Kết quả:
