Unload NPAPI plugin using script method call

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.

1 Answer

  1. Kevin- Reply


    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- and you delete that and put a new plugin in ~/Internet Plugins/MyPlugin- 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>