Re: NPN_Evaluate changed from FFx 14 to FFx 15
Rudi Sherry <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.plugins |
|---|---|
| Message-ID | <[email protected]> |
On Sep 12, 2012, at 10:57 AM, Benjamin Smedberg wrote:
> On 9/10/2012 5:24 PM, Rudi Sherry wrote:
>> We have a plugin that calls NPNEvaluate with "new Array;"
>>
>> NPVariant outObj;
>> NPString str = { "new Array;", 10 };
>> NPBool success = NPN_Evaluate(ourInstance, jsObjectForPlugin, str, &outObj);
>>
>> where 'jsObjectForPlugin' was set by the SetProperty callback, in the class returned when the container asked for NPPVpluginScriptableNPObject.
>>
>> The HTML Javascript looks something like:
>>
>> pluginObj.objForPlugin = { onMessage: function(msg) {}, onError: function(data) {} };
>>
>> (which invokes the SetProperty method in our plugin class).
>>
>> ...so jsObjForPlugin corresponds to the inline object containing those two function properties.
>>
>> In Firefox 14 (and every Firefox back to 3.x), NPN_Evaluate() returns 'true' and the outObj is type NPObject/
>> In Firefox 15, NPN_Evaluate() returns 'false' and the outObj is of type NPNull.
>
> I was not able to replicate your problem. I created a simple test plugin
> (sources at https://github.com/bsmedberg/blue-fishmonger-testplugin) and
> in both Firefox 15 and mozilla trunk I get NPN_Evaluate working
> correctly with the NPPVpluginScriptableNPObject as the scope object.
>
> Is it possible that the code in question is running across multiple
> frames? We did make changes in Firefox 15 related to how JS runs when it
> touches objects from other frames/windows, and that could be affecting
> the scope lookups here. I'd love to see this problem in action with the
> smallest testcase you can come up with. File a bug and cc me if appropriate.
I'm having trouble with reproducing this with simple cases; I'll get back to the person that reported it to me and see if it's a cross-frame issue (that's very possible).
Thanks,
Rudi