Barry MacKichan
2014-05-23 18:06:08 UTC
I have a XulRunner-based app. We forked the XulRunner code in 2008.
If I embed an object of a certain type in a document, I can control it using JavaScript. But if I save the document and reload it, I get the following situation.
There is a property to tell if the data for the object is loaded. This is obj.readyState. It returns 2 if everything has been loaded. When my code checks for it, it returns void. If I set a JS breakpoint there and then execute that line, it still returns void. If I evaluate "obj.readyState" in Venkman, I get 2. From that point on, I always get 2.
I traced the C++ code in each case. In the case where I evaluated "obj.readyState" in the debugger, I could see the value coming back from the plugin, in NPObjWrapper_GetProperty. When I traced it as my program executed that line, it seemed like the context was messed up.
My question: Is this caused by an incorrect context, like the "NPMethod called on non-NPObject wrapped JSObject" problem for methods? If so, how do I fix it. In the method case, I passed 'obj' explicitly as a parameter, which I can't do in the case of a property.
--Barry
If I embed an object of a certain type in a document, I can control it using JavaScript. But if I save the document and reload it, I get the following situation.
There is a property to tell if the data for the object is loaded. This is obj.readyState. It returns 2 if everything has been loaded. When my code checks for it, it returns void. If I set a JS breakpoint there and then execute that line, it still returns void. If I evaluate "obj.readyState" in Venkman, I get 2. From that point on, I always get 2.
I traced the C++ code in each case. In the case where I evaluated "obj.readyState" in the debugger, I could see the value coming back from the plugin, in NPObjWrapper_GetProperty. When I traced it as my program executed that line, it seemed like the context was messed up.
My question: Is this caused by an incorrect context, like the "NPMethod called on non-NPObject wrapped JSObject" problem for methods? If so, how do I fix it. In the method case, I passed 'obj' explicitly as a parameter, which I can't do in the case of a property.
--Barry