0

I wrote a plugin in Firebreath, and I have a msi written.

I want to write a JavaScript function that will trigger an installation(a pop up in the top of the page) or will redirect the user to a download page. Can someone provide an example or a helpfull link?

Thanks!

sara
  • 3,824
  • 9
  • 43
  • 71

1 Answers1

1

FireBreath has an example javascript file that can be used to help with plugin detection:

https://github.com/firebreath/FireBreath/blob/master/Installer/js/fb_installer.js

basically you use FireBreath.isPluginInstalled("yourPlugin") to see if the plugin has been installed yet or not.

You can use FireBreath.injectPlugin("yourPlugin", divContainer, "pluginId", callback) to add the plugin to the page after you have verified that the plugin is installed, and if you find that the plugin is not installed and display a download link to the MSI you can use FireBreath.waitForInstall("yourPlugin", callback) to have your callback function called when the plugin shows up.

The script may not be perfect, but it should give you a good starting point.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • I don't want firebreath specipic functions – sara Jun 02 '11 at 07:51
  • that's fine... just rewrite it so that they aren't firebreath specific. You ask for javascript functions that will do that. I gave you javascript functions that will do that. It's licensed under the new BSD license, so you can pretty much do whatever you want with them. – taxilian Jun 02 '11 at 18:23