0

The code below should be self explanatory

NPP_PostURLNotify() //post to a URL that returns a pure java script code 
NPP_WriteReady()  
NPP_Write()  // when the browser calls back this function does it execute that java script before calling this function?

UPDATE: Ok, i spent some time and figured that it doesn't.

JamesWebbTelescopeAlien
  • 3,547
  • 2
  • 30
  • 51

1 Answers1

0

Apparently it doesn't. It feeds raw contents to the plugin.

JamesWebbTelescopeAlien
  • 3,547
  • 2
  • 30
  • 51
  • 1
    It is not specified in the NPAPI specification, which means that different browsers and different versions of those browsers may implement it differently. This is really a bad way to call javascript anyway; use NPN_Evaluate or GetValue the window object and call functions. – taxilian Jan 05 '13 at 23:23
  • I tested this on safari ,chrome and firefox, they all feed raw data. Why is it bad way to call though? – JamesWebbTelescopeAlien Jan 07 '13 at 19:17
  • Because it's much slower than all of the other ways, much less direct. It goes through a bunch of weird hoops rather than directly executing the javascript. – taxilian Jan 08 '13 at 00:36
  • Does this hold true for Windowless plugins? +1 for spec info – JamesWebbTelescopeAlien Jan 08 '13 at 03:24
  • Windowless or windowed plugins is just how it is drawn; has nothing to do with the javascript interface. I can't give you spec links on speed differences, only my own a) intuition (because it makes sense that using JS directly is faster) and b) experience (because I actually have benchmarked the performance using javascript through a URL call vs javascript through NPN_Evaluate and the direct route was *way* faster). I haven't done these tests recently, but I don't know why you'd want to use a URL when you can use NPN_Evaluate – taxilian Jan 08 '13 at 08:07