0

I made a plugin for the browser to firebreath (Windows). Now I do update the plugin - but dll plugin can not be upgraded until the plugin is loaded.

How do I restart the browser to refresh the plug-in? or as a plug-in that can be downloaded from the browser cache?

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236

2 Answers2

1

The options i see are:

  • tell the user to restart the browser after installation/update
  • tell the user to close the browser(s) before proceeding with installation

Note that you still may have issues replacing the DLL. What e.g. Flash does is suffixing their filename with the version (e.g. npYourPlugin_1_2_77.dll), so file locks are no issue.

If you do that you might not even need to restart the browser when you can call navigator.plugins.refresh() (works since Firefox 17, not sure about other browsers though).

Also note that i'm not sure about the ActiveX plugin (IE) if you need to support that as well - maybe taxilian will chime in on that and other scenarios i haven't run into myself.

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
  • 1
    You've covered the main things I'd mention; I have before managed to upgrade an IE control in-place (using a version number in the filename as you suggest, additionally placing it in a version-specific folder) but never with FireBreath, and it is possible there is something in what FireBreath is doing that is preventing it from working as nobody I know of has gotten it to work with FireBreath. – taxilian Jul 28 '13 at 00:11
  • files with the version I have helped! Thank you! but I'm wondering how to reboot the browser from c + + code – user2618420 Aug 02 '13 at 09:27
  • If you mean from the plugin - that's really not a good idea. If you mean from an external application (setup, updater), you could use system APIs to (gracefully) end the browser process. Note that this is still not a good idea unless you asked the user about it due to possible data loss. I think actually restarting browsers is not a trivial task - you could launch the binaries you just closed, but that might miss e.g. environment variables or settings done by some helper application that did the actual launch. – Georg Fritzsche Aug 05 '13 at 11:06
  • ok i understand this is a bad idea. but I have earned navigator.plugins.refresh () but not in ie! Only problem is it like to be? want that updates have been invisible to the user. is this possible or just a fairy tale – user2618420 Aug 05 '13 at 14:27
  • taxilian suggested above that this at least currently doesn't work with IE (see also [this question](http://stackoverflow.com/questions/16907979/does-firebreath-support-plugin-updates-in-internet-explorer-once-an-instance-is) and [this one](http://stackoverflow.com/questions/16402579/how-to-automatically-upgrade-a-firebreath-plugin/16423202#16423202)). It looks like you really might need to ask the user to close/restart IE if you need the plugin to be always up-to-date. – Georg Fritzsche Aug 05 '13 at 21:11
0

The steps of upgrading my firebreath plugin is

  1. Make the plugin installer by NSIS.
  2. In the begining of installing, detect whether the plugin is occupied by any browser or not.
  3. Closing all browsers who are using the plugin at the moment.
  4. Uninstall the previous version of pluin.
  5. Install the new version of plugin in the folder with latest version number.
  6. At the end of installing, restart browsers that is closed previously, and navigate to the URL you want.

By the way, just as Georg mentioned, you don't need to restart Chrome and Firefox after checking the version of the plugin, which means you have the routine to upgrade plugin and use the new one immediately. However, you have to restart IE, as when you get the version of an activex control, you have to instantiate it, which makes the plugin loaded first.

Right now, it work well and as expected.

Wayne Wang
  • 1,287
  • 12
  • 21