0

I am looking for a way to get javascript code before SpiderMoney (Firefox JS engine) or V8 (Chrome JS engine) evaluate the it.

I don't mean capturing the traffic and get it before the application does, but "hijacking" the javascript before it reaches the JS engine itself.

Does anyone know how to do it, or at least point me to the correct direction?

TCS
  • 5,790
  • 5
  • 54
  • 86
  • More information is required. Is this your site? You have control over editing the HTML and other code? Why do you need to do this? – Sparky Jul 14 '11 at 17:12
  • 1
    It is not a site, but an application/add-in to a browser. It is part of my academic research. I want to know what JS is going into the JS engine (as a string) before it actually goes there. – TCS Jul 14 '11 at 17:37
  • This does not seem like a programming question. Can you post any code or explain what you've tried so far. – Sparky Jul 14 '11 at 17:46
  • 1
    I didn't write any code yet, because I don't know where to begin (that is my question). I checked out JaegerMonkey and V8, and I found out that I can download them and run them as embeded engine or even as stand alone, but I want to attach my application/DLL to a browser (firefox or chrome) and not to use the library. – TCS Jul 14 '11 at 17:58
  • Does it have to be an add-on or can you use your own build of the browser? In the latter case, it's a matter of finding the entry point that compiles the input JS strings, in the former, I'd look into implementation of JS debugger extensions (Firebug). – Nickolay Jul 16 '11 at 23:40

1 Answers1

0

I compiled my own build of SpiderMonkey. Once I've done that I called my own function before the compile() function of the engine.

The function is not exported so it cannot be hooked (replaced during runtime), only patched.

TCS
  • 5,790
  • 5
  • 54
  • 86