What is the scope argument to NPN_Evaluate
for, really? In this question, it's explained that you can not limit the scope of eval()
. I thought NPN_Evaluate()
was equivalent to eval()
?
I am calling NPN_Evaluate
with different NPObjects
as the scope, and I don't see any difference. My script is alert(this.name)
and I was expecting that this
would be the object I am passing into NPN_Evaluate
as the scope. But instead, this
is actually window
, regardless of what I pass in. Examples on using NPN_Evaluate
on the net show people always using the window object...
I'm a little unsure of what's going on, so I am not ruling out a mistake in my code just yet, however from what I can see, the above seems to be the case. Any information on the intended use of the scope argument would be welcome.