title: Intercept calls to console.log in Chrome
body: <p>I have a script that I can't change that makes a lot of <code>console.log</code> calls. I want to add another layer and respond if the calls contain certain strings. This works in Firefox, but throws an &quot;<code>Illegal invocation</code>&quot; error in Chrome on the 4th line:</p>
  <pre><code>var oldConsole = {};
  oldConsole.log = console.log;
  console.log = function (arg) {
      oldConsole.log('MY CONSOLE!!');
      oldConsole.log(arg);
  }
  </code></pre>
  <p>Any ideas how to get around that? I also tried cloning the console...</p>