添加 FF 应用程序菜单项(无需重启)
我正在尝试创建一个无需重新启动的 Firefox 插件,并且在 Firefox 应用程序菜单中(最好在“选项”子菜单中)有一个菜单项。我在任何地方都找不到有关如何在无需重新启动的情况下向应用程序菜单添加条目的任何内容!我正在使用 Mozilla Addon Builder 构建它。任何和所有的帮助将不胜感激!
I am trying to create a Firefox add-on that is restartless and has a menu entry in the Firefox App Menu (preferably in the Options sub-menu). I cannot find anything anywhere on how to add an entry to the app menu while being restartless! I am building it with the Mozilla Addon Builder. Any and all help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,确实没有办法做到这一点。 “正常”的无需重新启动的插件必须枚举所有打开的浏览器窗口并添加菜单使用
id="appmenu-popup"
“手动”输入元素。它还必须监视正在打开的新窗口才能使那里也有同样的变化。虽然这已经足够复杂了(bug 675387 是为了通过允许使用像在不可重新启动的附加组件中一样覆盖)我强烈怀疑附加组件 SDK(附加组件生成器所基于的)根本不提供任何方法来执行此操作。毕竟,它仅适用于可以使用有限功能的附加组件。In fact, there isn't really a way to do this. A "normal" restartless add-on has to enumerate all open browser windows and add a menu entry "manually" to the element with
id="appmenu-popup"
. It will also have to watch for new windows being opened to make the same change there as well. While this is already complicated enough (bug 675387 is about making this simpler by allowing using overlays like in non-restartless add-ons) I strongly suspect that the Add-on SDK (that the Add-on Builder is based on) doesn't provide any way to do this at all. After all, it is only meant for add-ons that can live with a limited set of features.