Catching any and all script function calls when automating IE



Hi all,

I'm automating Internet Explorer, connecting to all running instances,
and what I'd like to do is receive an event for any Javascript function
calls made on the page. I've already sunk HTMLDocumentEvents, from
which I can catch the document events, but this isn't quite what I
need. Rather, if some event calls function foo(), and foo() calls
bar(), I'd like to receive two events, one telling me that foo was
called (with its parameters) and the other telling me that bar was
called.

Ideally, I'd even like to "de-bubble" the function calls -- that is,
get an event prior to the function actually being run, and do my own
thing, canceling the function.

My intuition says that the Script() property of IHTMLDocument2 is the
right way to go, but the only documentation I can find on that
describes how to call script functions from it by referring to it as an
IDispatchEx. I've got to think, though, that that object implements
some other, more descriptive interface; if I'm right, does anyone know
what interface that would be? How does the Microsoft Script Debugger
work? What I'm trying to do is somewhat similar to that.

I'm writing this all in C++/ATL, but a response referring to any
language would be fine. Thanks in advance.

-Marco

.



Relevant Pages

  • Catching any and all script function calls when automating IE
    ... Rather, if some event calls function foo(), and foocalls ... My intuition says that the Script() property of IHTMLDocument2 is the ... some other, more descriptive interface; if I'm right, does anyone know ... I'm writing this all in C++/ATL, but a response referring to any ...
    (microsoft.public.scripting.vbscript)
  • Re: [PHP] Passing variables between pages
    ... You always have the option to write one huge script for any application. ... we use sessions to pass variables between scripts -- but we could ... So just defining $foo saying include 'steptwo.php' ... I do use this technique inside of my templating class though. ...
    (php.general)
  • Re: Redirect file output into variables
    ... Hmm, i would use a safe interpreter for that..., as you say limited ... interp alias foo puts buffered_puts ... set script "script you want to execute in a safe environment" ...
    (comp.lang.tcl)
  • Re: A subst-antial question
    ... Suppose I have a script: ... I know I have to substitute variables locally before I can set them ... stuff with $foo in it ... An alternative, in Tcl 8.5 (or 8.4 with the dict package), would be to not perform the substitutions locally, but instead to snapshot the environment of the script as a dict, and then send that along with the code to be evaluated remotely using: ...
    (comp.lang.tcl)
  • Re: 1352 NUL bytes at the end of a page? (was Re: Assertion `s && s->tree failed: The sag
    ... >> tests to the script to see if things are really slowing down with current kernels, ... > Are you sure the IDE disks are in DMA mode? ... time bk clone -qlr40514130hBbvgP4CvwEVEu27oxm46w testing-2.6 foo ...
    (Linux-Kernel)