Subj : JSPrincipals... To : netscape.public.mozilla.jseng From : Oystein Hallaraker Date : Wed Jun 02 2004 01:03 pm Hi! I have a couple of questions: 1. I am a bit confused about how spidermonkey uses the JSPrincipals that are sent to the engine through the api call JS_EvaluateStringForPrincipals(). When does spidermonkey use this information? Is that information only used when spidermonkey calls native() (in js_Invoke()) so that the DOM can enforce the same origin policy? And I have been trying to understand the native() call. I understand that it is a function pointer, but where are the actual functions that are beeing called implemented? 2. I am trying to get the url of the executing script in the function js_Invoke(). If I understand it correctly, this information is included in the JSScript which is being executed. But how do I get the JSScript from the JSContext? Is it possible to get the url of origin of a script in js_Invoke()? I have been told earlier that spidermonkey dosn't concern itself with the origin of javascripts and that it is the DOM that is responsible for doing access control. But since the JSPrincipals of a script is sent to the engine, it must be possible to extraxt this information in js_Invoke? 3. Is calls to native() the only way which script executing in spidermonkey can access(set or get properties) the DOM? Some help would be greatly appreciated! Oystein .