问题
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!
回答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.
来源:https://stackoverflow.com/questions/6199783/plugin-installation