Can I install plugin without restarting the browser and machine
Asked Answered
F

2

5

I have developed one NP API plugin and was playing with it. I observed below two things

  1. When I install the plugin first time I need to restart my mac os to load the plugin.
  2. Whenever I update the plugin I need to restart browser.

I want to install plugin without restarting the browser and machine. Please advice

Frausto answered 11/8, 2011 at 18:42 Comment(0)
N
11

As long as you install it as a plugin and not as an extension (such as XPI on firefox) you don't need to restart the browser. On Mac OS X that means putting the .plugin file in either /Library/Internet Plugins/ or in ~/Library/Internet Plugins/. You can instruct the browser to reload the list of plugins like this:

navigator.plugins.refresh(false);

The false tells it not to refresh the page to do it.

Updating is a slightly different problem; the browsers will not notice that a plugin update has occurred without restarting the browser unless the filename is different from the original. My usual solution is to include the version number of the plugin in the .plugin/ bundle filename, something like "FBTestPlugin_1.0.0.plugin", so when it updates it gets named differently.

On windows different NPAPI browsers have different problems with plugin detection (and different versions of those browsers), but the best way I've found to make this work is to install each plugin in a version-specific subdirectory with a version-specific filename; this seems like overkill, but the cases I was addressing were with a plugin that had 50 million installs and it was necessary for all supported browser versions to work. I was also using the registry install method (HKCU/Software/MozillaPlugins).

Hope that helps

Noni answered 11/8, 2011 at 19:46 Comment(3)
Thanks Taxilian, you are the Guru of NPAPI plugins :) .. My concern is only for Mac OS as i am targeting MAC only. Appreciate your responseFrausto
heh. no, I'm just the most vocal; there are many who know this stuff far better than I, but unfortunately most of them keep to themselves. Glad I could help.Noni
Hi Taxilian, even after giving above javascript why i need to refresh the Html page 2 times in order to call any method on plugin from javascript. Please advice if you have any thoughts.Frausto
D
0

After you installed a plugin on windows, you should call like this:

navigator.plugins.refresh(true);

to reload current page containing the plugin. please see http://www.devguru.com/technologies/javascript/11232

Damask answered 14/3, 2013 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.