Question

I have NPAPI plugin for Mac Safari/fire Fox browser.The plugins has several method and I can call it from java script.I wanted to know whether I can close or unload the plugin through implementing method inside it.I need this function to unload the plugin from browser/memory.

Was it helpful?

Solution

Short answer: No.

Longer answer: not really. What you can do is remove the object tag from the DOM, which will cause that instance to be unloaded. It makes no guarantees that the browser will unload the module, but it does at least get the instance out of your way.

Most people who want to do that are trying to find a way to update the plugin without closing the browser; you can do this, but you need to install the new plugin with a different filename than the old plugin. I'm talking about the filename of the .plugin/ bundle, not the binary inside it.

If you have a plugin in ~/Internet Plugins/MyPlugin-1.0.0.0 and you delete that and put a new plugin in ~/Internet Plugins/MyPlugin-1.0.0.1 and then in javascript you call navigator.plugins.refresh(false); the browser will find the new plugin and when you instantiate it it'll give you the new version. The bundle has to be named differently, though; that's the key.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top