Re: CanExecuteScripts's context doesn't have a JSScript*?

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Doug Turner wrote:
> An answer to my question is that this method is probably called to
> early for any frames to be on the stack.

Yep.

> If that is the case, is there a way to get the file name associated with the JSContext in this
> method

There is no filename associated with a JSContext.  A filename is associated with 
a particular bit of script, and the relevant JSAPI caller will know it.  If you 
hook into all the places in nsJSContext that call CanExecuteScript that will get 
you most of the callers, I think, but there are some others (in XBL, etc).

> Basically, what I want to know is "where
> did the script that this method get call about come from?"

CanExecuteScript does't have that information.  All it knows are the permissions 
that the script should have when it executes.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.