Plugin Installation

独自空忆成欢 提交于 2020-01-06 07:14:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!