StatCounter

Thursday, June 19, 2014

Browser "Virus" Handling


I decided to compare a few browsers to see how well they could handle a fake virus.


 This code, written in HTML and Javascript, will make infinite alert popups, saying 'Try to Quit'.

This could be very annoying, because alerts stop you from doing anything in the browser. In this case, it will never allow you to visit other pages. Trying out this code in Safari even made me to force-quit, which could make you lose a lot of unsaved/valuable info.


















For those of you willing to risk it, try the html code:


<!DOCTYPE html>
<html>
<body>

<p>Click to die:</p>

<button onclick="myFunction()">Virus Attack</button>

<script>
function myFunction() {
  while(1) {//Infinite Loop!
    alert("Try to quit!");
  }
}
</script>

</body>
</html>

(copy-paste this code to a text-editor and save it as a .html file)
(press the Virus Attack button, and the popups will appear. If you have trouble, just force quit the app)

Disclaimer: I am not responsible for any damage caused by this fake virus. USE AT YOUR OWN RISK!!!!! 

Now, the error handling:

Google chrome did a good job, as it was able to detect repetitive messages, giving me the option to stop the virus:









After check marking it, I recieved no more popups.


Firefox couldn't disable repetitive messages, but unlike safari(the last one), it didn't stop you from saving/closing webpages:











On Safari, it did the worst, because it couldn't cancel, while all other webpages are stopped:



So far, I would say Chrome is the best ranking in this test, then Firefox, while Safari din't do a great job handling the fake virus attack.

No comments:

Post a Comment