From my point of view it should be some code on javascript side, setting up callback function in NPAPI plugin. On NPAPI side it should be some way to call this callback function, thus sending notification from NPAPI to javascript.
I am trying to do it for Chrome browser but it should work for any browser supporting NPAPI. Short NPAPI and javascript code example would be very helpful.