Thanks for the reply. On Mar 8, 6:34 pm, Benjamin Smedberg <[email protected]> wrote: > On 3/8/2011 7:57 AM, Darth Coder wrote:
> There is very likely a method in one of the interfaces (nsIDocument or > one of its parents) which is #ifdef DEBUG. You are compiling Mozilla > *without* DEBUG, but perhaps you are compiling your code with DEBUG? > They need to match. Yes, that might possibly be the reason. I will check, > > Second Issue: > > > I am building a debug version of the same mozilla code base and > > linking with the debug target of my app. In this case too the app > > builds fine, but when I try to execute a JS function from the HTML > > document using the JS_CallFunctionName JSAPI, I am getting an assert > > > cx == topJSContext, "wrong context on XPCJSContextStack!" from > > xpcquickstubs.cpp:xpc_qsAssertContextOK() > > You should pretty much never be using raw JSAPI in this case. XPConnect > (the XPCOM<->JS bridge) keeps track of the security principles on the > stack for all calls, and you are making a call that XPConnect doesn't > know about. Whatever you are doing, you should probably be doing it in a > JS component/module, and not in binary code and JSAPI. > > --BDS 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. We have the JSAutoRequest object in scope of the JSAPI call. 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. Essentially the functionality we need is to call any JS function by name from native C++ once a HTML page has been loaded. _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
