我可以在不重新启动浏览器和机器的情况下安装插件吗
我开发了一个 NP API 插件并正在使用它。我观察到以下两件事:
- 当我第一次安装插件时,我需要重新启动我的 mac 操作系统来加载插件。
- 每当我更新插件时,我都需要重新启动浏览器。
我想安装插件而不重新启动浏览器和机器。请指教
I have developed one NP API plugin and was playing with it. I observed below two things
- When I install the plugin first time I need to restart my mac os to load the plugin.
- Whenever I update the plugin I need to restart browser.
I want to install plugin without restarting the browser and machine. Please advice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要您将其安装为插件而不是扩展(例如 Firefox 上的 XPI),就不需要重新启动浏览器。在 Mac OS X 上,这意味着将 .plugin 文件放入 /Library/Internet Plugins/ 或 ~/Library/Internet Plugins/ 中。您可以指示浏览器重新加载插件列表,如下所示:
false 告诉它不要刷新页面来执行此操作。
更新是一个稍微不同的问题;如果不重新启动浏览器,浏览器将不会注意到插件更新已发生,除非文件名与原始文件名不同。我通常的解决方案是在 .plugin/ 包文件名中包含插件的版本号,例如“FBTestPlugin_1.0.0.plugin”,因此当它更新时,它的名称会有所不同。
在 Windows 上,不同的 NPAPI 浏览器在插件检测方面存在不同的问题(以及这些浏览器的不同版本),但我发现实现此目的的最佳方法是将每个插件安装在特定于版本的子目录中,并使用特定于版本的文件名;这似乎有点矫枉过正,但我所解决的案例是使用一个安装量为 5000 万次的插件,并且所有受支持的浏览器版本都必须工作。我还使用了注册表安装方法(HKCU/Software/MozillaPlugins)。
希望有帮助
As long as you install it as a plugin and not as an extension (such as XPI on firefox) you don't need to restart the browser. On Mac OS X that means putting the .plugin file in either /Library/Internet Plugins/ or in ~/Library/Internet Plugins/. You can instruct the browser to reload the list of plugins like this:
The false tells it not to refresh the page to do it.
Updating is a slightly different problem; the browsers will not notice that a plugin update has occurred without restarting the browser unless the filename is different from the original. My usual solution is to include the version number of the plugin in the .plugin/ bundle filename, something like "FBTestPlugin_1.0.0.plugin", so when it updates it gets named differently.
On windows different NPAPI browsers have different problems with plugin detection (and different versions of those browsers), but the best way I've found to make this work is to install each plugin in a version-specific subdirectory with a version-specific filename; this seems like overkill, but the cases I was addressing were with a plugin that had 50 million installs and it was necessary for all supported browser versions to work. I was also using the registry install method (HKCU/Software/MozillaPlugins).
Hope that helps
在 Windows 上安装插件后,您应该像这样调用:
重新加载包含该插件的当前页面。请参阅http://www.devguru.com/technologies/javascript/11232
After you installed a plugin on windows, you should call like this:
to reload current page containing the plugin. please see http://www.devguru.com/technologies/javascript/11232