From: jshanman on

I am trying to capture the filename of an external script (which I do
not have access to change). The external script has document.write,
which I have overridden with my own function dw. This external script
can be from many sources and the context of the document.write is
sometimes global and sometimes within named/anonymous functions.

From within dw, I want to figure out in which external script (by url)
that the original document.write was called. I am able to do this in
all major browsers except IE and safari by using the stack trace
methods and regex parsing.

Is this possible to accomplish in IE (7+) and Safari?

Here is my test page: (view source)
which include the very simple external js file:

- Justin