views:

115

answers:

1

Hi, I'm writing an NPAPI plugin that injects a script with a src located at my server. After the injection, my plugin tries to call a function in the script. But this doesnt seem to work. I think the reason is the same origin policy, but im not sure how to overcome it.

The call to the function works if i inject the script code completely into the page from the plugin. The only situation it doesnt work is when i give a src and keep the script in my server.

Any help would be appreciated.

Thanks

A: 

NPAPI plugins are not limited by origin policies, AFAIK, but you may want to keep in mind that injecting the script tag into the body will not synchronously load the javascript file; you'll have to wait a bit before you'll be able to access it. I would guess that this is most likely your problem.

Taxilian