Javascript examples for Browser Object Model:Window alert
Detecting alerts with a Chrome extension
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* ww w . j a v a2s . c om*/ var native_alert = alert; alert = function(msg) { console.log('call to console.log() - message: '+msg); native_alert(msg); } console.log('intercepted!'); } </script> </head> <body> </body> </html>