On 3/8/11 11:00 AM, Darth Coder wrote:
The app was originally written to work with the Firefox 2.0 code base
and it used to work fine. Now the code has to be moved to Mozilla
1.9.2.12. The client app is essentially a web browser container (using
embedded Gecko) into which a special HTML page is loaded and when the
page is fully loaded (captured via the nsIWebProgressListener), a JS
Function contained within the page is explicitly called from the
Native C++ code. The code is written such that it obtains the
JSContext and JSGlobalObject from the html page's dom (nsIDocument
object) and then calls the JS_CallFunctionName method with the name of
the JS function to execute.

But you don't push the relevant JSContext on the xpconnect stack? That would cause your assertion failures for sure.

I am not sure if this is no longer the right way to achieve this, if
this is not right, please let me know the proper way to achieve this.

If you're not pushing the right JSContext on the stack, then you were never doing it the "right" way. It's just that now we added asserts for the security fail that results....

You probably want to look at what nsJSContext::CallEventHandler does before the JS_CallFunctionValue call it makes.

-Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to