Re: NPN_Evaluate changed from FFx 14 to FFx 15

Benjamin Smedberg <[email protected]>
Newsgroups gmane.comp.mozilla.devel.plugins
Message-ID <[email protected]>
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.
I am pretty certain that `jsObjectForPlugin` is not the value you want.

This parameter is supposed to identify the *scope* object that you're 
evaluating against. In almost all cases, you should be passing `window` 
as your scope object, and I'm certain that's what you want in this case.

I'm not sure why we allow you to specify other scope objects, or whether 
we should just ignore the scope parameter because `window` is always 
correct.

I'm also interested in figuring out why this used to work but doesn't 
any more; I'll try to look at this.

--BDS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.