window.alert = function(msg){console.log('foo' + msg);};
alert("bar");
foobar
screenshot of chrome console:
My problem is if I try disable debugger;
command with this, do not work:
window.debugger = function(){console.log('faa');};
debugger;
when I run debugger;
, breakpoint stop my app.
debugger
is not a member ofwindow
, it's only a sign for the browser to know to stop there on debug mode.