2

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.

Community
  • 1
  • 1
Innovine
  • 1,872
  • 2
  • 12
  • 10
  • Further testing reveals that this behaviour only appears in one of my target browsers (webkit based). I'd still appreciate information, though, especially if it's confirming that I'm looking at a bug. – Innovine Oct 16 '12 at 07:17

0 Answers0