Listening console.log
问题 I want to set a listener for console.log() and do something with the message without preventing the default behaviour. So, the console of the dev tools should get the message as well. Any ideas? 回答1: Never tried this in a webpage, but it work in a browser plugin (where javascripts rights are are not the same for security reasons). You could definitively go for something like this : (function(){ var originallog = console.log; console.log = function(txt) { // Do really interesting stuff alert(