July 4, 2012

Prevent alert boxes from appearing in Firefox

Question by Trevor Roberts

I can use this in my Opera browser to stop the alert boxes from appearing:

javascript:function alert () {}

However, it does not work whenever I use this in Firefox. What is the command to stop the alerts in Firefox?

Answer by Starx

This can be done like this

window.alert = function() { return false; }

But, if you want to stop the alert boxes, best solution is not to use alert() at all.
Disabling the JavaScript functions in not right solution.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!