插件安装 [英] Plugin Installation

查看:98
本文介绍了插件安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Firebreath编写了一个插件,并且写了一个msi.

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

我想编写一个JavaScript函数来触发安装(页面顶部弹出窗口) 或会将用户重定向到下载页面. 有人可以提供示例或有用的链接吗?

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?

谢谢!

推荐答案

FireBreath有一个示例javascript文件,可用于帮助检测插件:

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

基本上,您使用FireBreath.isPluginInstalled("yourPlugin")查看插件是否已安装.

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

在确认已安装插件后,可以使用FireBreath.injectPlugin("yourPlugin", divContainer, "pluginId", callback)将插件添加到页面,如果发现未安装插件并显示MSI的下载链接,则可以使用FireBreath.waitForInstall("yourPlugin", callback)在插件显示时调用您的回调函数.

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.

这篇关于插件安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆