title: A good way to build javascript profiler for Mozilla Firefox
body: <p>I'm working on a javascript profiler for Mozilla Firefox, that would let me obtain all available information about the execution of the script on the page (DOM object calls, events, calls to functions like Math.random(), document and navigator object calls, as well as code's own execution tree with arguments etc etc).</p>
  
  <p>Currently, I think that the best way to implement this sort of profiler is by modifying Firefoxe's own source code.</p>
  
  <p>One way to go about it is to find all implementations for corresponding method calls and add profiler log calls there. But there are 2 problems with this approach:</p>
  
  <ol>
  <li><p>The methods and objects are widely scattered, and I'm not really familiar with the source code at this moment. Tracking down all the functions and making sure that the profiler works as intended will take A LOT of time</p></li>
  <li><p>When created in this way, the profiler is going to be difficult to maintain when Firefox source code evolves with time.</p></li>
  </ol>
  
  <p>So I was wondering, if there is a single class/a small group of key classes in firefox source, that could be modified to allow me to collect the information I want? Or is there a better way of doing what I need to do?</p>